Пример #1
0
 public ActionResult <ItemResponse <int> > AddProfile(UserProfileAddRequest model)
 {
     try
     {
         int id = _profileService.AddProfile(model, _authService.GetCurrentUserId());
         ItemResponse <int> resp = new ItemResponse <int>();
         resp.Item = id;
         return(Created201(resp));
     }
     catch (Exception ex)
     {
         Logger.LogError(ex.ToString());
         return(StatusCode(500, new ErrorResponse(ex.Message)));
     }
 }
        public ActionResult <ItemResponse <int> > Add(UserProfileAddRequest_V2 model)
        {
            ObjectResult result = null;

            try
            {
                int userId = _authService.GetCurrentUserId();
                int id     = _service.AddProfile(model, userId);
                ItemResponse <int> response = new ItemResponse <int>()
                {
                    Item = id
                };
                result = Created201(response);
            }
            catch (Exception ex)
            {
                base.Logger.LogError(ex.ToString());
                ErrorResponse response = new ErrorResponse(ex.Message);
                result = StatusCode(500, response);
            }
            return(result);
        }