/// <summary> /// Deletes the protocol. /// </summary> /// <param name="customerId">The customer identifier.</param> /// <param name="protocolId">The protocol identifier.</param> /// <returns></returns> public async Task <DeleteProtocolStatus> DeleteProtocol(int customerId, Guid protocolId) { var result = await protocolService.DeleteProtocol(customerId, protocolId); if (result == DeleteProtocolStatus.Success) { await globalSearchCacheHelper.RemoveEntry(customerId, protocolId); var unusedTags = await tagsService.RemoveUnusedTags(customerId); await tagsSearchCacheHelper.RemoveTags(customerId, unusedTags); } return(result); }
public IActionResult Delete(int id) { if (id < 1) { return(BadRequest()); } try { protocolService.DeleteProtocol(id); return(RedirectToAction(nameof(Index))); } catch (Exception ex) { return(NotFound(ex)); } }