public AgregarEspecieResponse Agregar(AgregarEspecieRequest request)
 {
     try {
         var response = new AgregarEspecieResponse();
         var bc       = new EspecieComponent();
         response.Result = bc.Agregar(request.Especie);
         return(response);
     }
     catch (Exception ex) {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422, // UNPROCESSABLE ENTITY
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
示例#2
0
        public Especie Agregar(Especie especie)
        {
            var bc = new EspecieComponent();

            return(bc.Agregar(especie));
        }