Example #1
0
 public IHttpActionResult UpdatePassword([FromBody] ResetPasswordDto resetPasswordDto)
 {
     // Model Binding Validation
     if (!ModelState.IsValid)
     {
         return(BadRequest(GeneralErrorMessages.MODEL_STATE_ERROR));
     }
     try
     {
         var resetPasswordManager = new ResetPasswordManager(resetPasswordDto);
         var response             = resetPasswordManager.UpdatePassword();
         if (response.Error != null)
         {
             return(BadRequest(response.Error));
         }
         // Sending HTTP response 200 Status
         return(Ok());
     }
     // Catch exceptions
     catch (Exception)
     {
         // Sending HTTP response 400 Status
         return(InternalServerError());
     }
 }