public async Task <ActionResponse> DeleteRight(int rightId) { try { if (rightId == 0) { return(new ActionResponse { Message = "Nothing was deleted on id = 0", Status = ActionStatus.Warning }); } await _securityContext.DeleteRight(rightId); return(new ActionResponse { Status = ActionStatus.Success }); } catch (SecurityDbException e) { return(new ActionResponse { Status = ActionStatus.Warning, Message = PrettyExceptionHelper.GetMessage(e) }); } catch (Exception e) { Console.WriteLine(e); return(new ActionResponse { Status = ActionStatus.Error, Message = "Something went wrong!" }); } }