Quantcast
Channel: enviar fecha nula a WebApi .NET
Viewing all articles
Browse latest Browse all 10

enviar fecha nula a WebApi .NET

$
0
0

también a la hora de recibir la entidad si ese campo va a nulo retornaria un mensaje de error indicando que debe digitar la fecha y retornando un HttpStatusCode.BadRequest

HttpResponseMessage response = 
    this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Debe digitar la fecha");
throw new HttpResponseException(response);


Si se solucionó tu consulta no olvides marcar la respuesta. Si te ayudó, vótala como útil. Saludos



No se haría por el ModelState???

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images