public BackofficeResponse CreateOrUpdate(BackofficeRequest request) { long RequestDate = DateTimeHelper.Now; var response = new BackofficeResponse(); try { var dto = request.RData.FromJson <UsersDto>(); var result = Manager.CreateOrUpdate(dto, request.RUserId, request.TokenKey); response.Data = result.ToJson(); response.ResponseStatus = ResponseStatusType.OK.ToBool(); } catch (RequestWarningException rex) { response.ResponseStatus = ResponseStatusType.ERROR.ToBool(); response.ErrorType = rex.ErrorTypeProp.ToString(); response.ErrorMessage = rex.ExceptionMessage; } catch (KnownException kex) { response.ResponseStatus = ResponseStatusType.ERROR.ToBool(); response.ErrorType = kex.ErrorTypeProp.ToString(); response.ErrorMessage = kex.ExceptionMessage; } catch (Exception ex) { response.ResponseStatus = ResponseStatusType.ERROR.ToBool(); response.ErrorType = ErrorTypeEnum.UnexpectedExeption.ToString(); response.ErrorMessage = ex.StackTrace; Logger.AddFattalLog(LogTypeEnum.Fattal, "UserController.CreateOrUpdate", ex.Message, request.ToJson(), ex); } Logger.AddResponseLog((response.ResponseStatus == ResponseStatusType.OK.ToBool()) ? LogTypeEnum.Info : LogTypeEnum.Error, "UserController.CreateOrUpdate", request.RUserId, response.ErrorMessage, request.ToJson(), RequestDate, response.ToJson(), DateTimeHelper.Now); return(response); }