Created
August 7, 2016 18:57
-
-
Save eshapovalova/cd91ad0529b0251deb2d12aa0bebd36b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| using System.Net.Http; | |
| using System.Web.Http.Routing; | |
| namespace WebApiApp.Util | |
| { | |
| public class CustomConstraint: IHttpRouteConstraint | |
| { | |
| private string uri; | |
| public CustomConstraint(string uri) | |
| { | |
| this.uri = uri; | |
| } | |
| public bool Match(HttpRequestMessage request, IHttpRoute route, string parameterName, | |
| IDictionary<string, object> values, HttpRouteDirection routeDirection) | |
| { | |
| return !(uri == request.RequestUri.AbsolutePath); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment