diff --git a/src/Seq.Api/Api/Client/SeqApiClient.cs b/src/Seq.Api/Api/Client/SeqApiClient.cs index 82654bb..08da47c 100644 --- a/src/Seq.Api/Api/Client/SeqApiClient.cs +++ b/src/Seq.Api/Api/Client/SeqApiClient.cs @@ -121,6 +121,14 @@ public async Task DeleteAsync(ILinked entity, string link, TEntity cont new StreamReader(stream).ReadToEnd(); } + public async Task DeleteAsync(ILinked entity, string link, TEntity content, IDictionary parameters = null) + { + var linkUri = ResolveLink(entity, link, parameters); + var request = new HttpRequestMessage(HttpMethod.Delete, linkUri) { Content = MakeJsonContent(content) }; + var stream = await HttpSendAsync(request).ConfigureAwait(false); + return _serializer.Deserialize(new JsonTextReader(new StreamReader(stream))); + } + public async Task> StreamAsync(ILinked entity, string link, IDictionary parameters = null) { return await WebSocketStreamAsync(entity, link, parameters, reader => _serializer.Deserialize(new JsonTextReader(reader))); diff --git a/src/Seq.Api/Api/ResourceGroups/ApiResourceGroup.cs b/src/Seq.Api/Api/ResourceGroups/ApiResourceGroup.cs index 4555ef2..6616712 100644 --- a/src/Seq.Api/Api/ResourceGroups/ApiResourceGroup.cs +++ b/src/Seq.Api/Api/ResourceGroups/ApiResourceGroup.cs @@ -72,5 +72,11 @@ protected async Task GroupDeleteAsync(string link, TEntity content, IDi var group = await LoadGroupAsync().ConfigureAwait(false); await Client.DeleteAsync(group, link, content, parameters).ConfigureAwait(false); } + + protected async Task GroupDeleteAsync(string link, TEntity content, IDictionary parameters = null) + { + var group = await LoadGroupAsync().ConfigureAwait(false); + return await Client.DeleteAsync(group, link, content, parameters).ConfigureAwait(false); + } } } diff --git a/src/Seq.Api/Api/ResourceGroups/EventsResourceGroup.cs b/src/Seq.Api/Api/ResourceGroups/EventsResourceGroup.cs index beb8ce5..8610b36 100644 --- a/src/Seq.Api/Api/ResourceGroups/EventsResourceGroup.cs +++ b/src/Seq.Api/Api/ResourceGroups/EventsResourceGroup.cs @@ -155,7 +155,7 @@ public async Task DeleteInSignalAsync( if (toDateUtc != null) { parameters.Add("toDateUtc", toDateUtc.Value); } var body = signal ?? new SignalEntity(); - return await GroupPostAsync("DeleteInSignal", body, parameters).ConfigureAwait(false); + return await GroupDeleteAsync("DeleteInSignal", body, parameters).ConfigureAwait(false); } ///