public async Task <ActionResult> Delete(Guid id, bool redirect = false) { // we don't care about success...if it's *already* deleted, that's fine // if we throw an exception trying to delete, that's another matter await CurrentStore.DeleteErrorAsync(id).ConfigureAwait(false); return(redirect ? Json(new { url = Url.Action(nameof(Exceptions), new { store = CurrentStore.Name, group = CurrentGroup, log = CurrentLog }) }) : Counts()); }
public async Task <ActionResult> Delete() { var toDelete = await GetSearchAsync().ConfigureAwait(false); // we don't care about success...if it's *already* deleted, that's fine // if we throw an exception trying to delete, that's another matter if (toDelete.Id.HasValue) { // optimized single route await CurrentStore.DeleteErrorAsync(toDelete.Id.Value).ConfigureAwait(false); } else { await CurrentStore.DeleteErrorsAsync(toDelete).ConfigureAwait(false); } return(toDelete.Id.HasValue ? Counts() : Json(new { url = Url.Action(nameof(Exceptions), new { store = CurrentStore.Name, group = CurrentGroup, log = CurrentLog }) })); }