public async Task <ActionResponse> DeleteFunction(int functionId) { try { if (functionId == 0) { return(new ActionResponse { Message = "Nothing was deleted on id = 0", Status = ActionStatus.Warning }); } await _securityContext.DeleteFunction(functionId); 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!" }); } }