Esempio n. 1
0
 public Profile UpdateProfile([FromBody] Profile profile)
 {
     try
     {
         return(_profilesRepository.ChangeProfileData(profile));
     }
     catch (SqlException exception)
     {
         var response = new HttpResponseMessage(HttpStatusCode.NotFound)
         {
             Content = new StringContent(exception.Message)
         };
         throw new HttpResponseException(response);
     }
     catch (Exception exception)
     {
         var response = new HttpResponseMessage(HttpStatusCode.Conflict)
         {
             Content = new StringContent(exception.Message)
         };
         throw new HttpResponseException(response);
     }
 }