public ActionResult Create(ActionDTO action) { MethodBase method = MethodBase.GetCurrentMethod(); try { Action newAction = Mapper.Map <Action>(action); newAction.IsValid = true; newAction.Id = 0; var response = ActionRepo.Create(newAction); if (response > 0) { CreateLog(Enums.Success, GetMethodCode(method), LogLevel.Information); return(Ok(response)); } else { CreateLog(Enums.BadRequest, GetMethodCode(method), LogLevel.Warning); return(BadRequest(response)); } } catch (Exception ex) { return(HandleError(ex.Message, GetMethodCode(method))); } }