Exemple #1
0
 public IHttpActionResult Validate(string id)
 {
     try
     {
         string validationMessage;
         var    identification = _identificationService.Validate(id, out validationMessage);
         if (!string.IsNullOrEmpty(validationMessage))
         {
             return(BadRequest(validationMessage));
         }
         var identificationDto = AutoMapperConfig.Map <IdentificationDto, Identification>(identification);
         return(Ok(identificationDto));
     }
     catch (Exception exception)
     {
         var response = Request.CreateErrorResponse(HttpStatusCode.BadRequest, exception.Message);
         throw new HttpResponseException(response);
     }
 }