Advertisement
Guest User

Untitled

a guest
Sep 11th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.55 KB | None | 0 0
  1. namespace WebApi.Infrastructure.Validation
  2.  
  3. open System.Net
  4. open System.Net.Http
  5. open System.Web.Http.Filters
  6.  
  7. type ModelValidationFilterAttribute () =
  8.     inherit ActionFilterAttribute ()
  9.  
  10.     override this.OnActionExecuting actionContext =
  11.         DeltaOfTEntityTypeValidationProvider.searchAndValidateDelta actionContext
  12.         if not actionContext.ModelState.IsValid then
  13.             actionContext.Response <-
  14.                 actionContext.Request.CreateErrorResponse
  15.                     (HttpStatusCode.BadRequest, actionContext.ModelState)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement