Skip to content

Instantly share code, notes, and snippets.

@abhayachauhan
abhayachauhan / MustBeVersion.cs
Created September 30, 2015 23:53
Versioning Controller Selector
public class MustBeVersion : IRouteConstraint
{
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values,
RouteDirection routeDirection)
{
var val = values[parameterName] as string;
if (string.IsNullOrEmpty(val)) return false;
int versionNumber;
{
"provider": {
"name": "Event API"
},
"consumer": {
"name": "Consumer"
},
"interactions": [
{
"description": "a request to retrieve all events",
{
"provider": {
"name": "Event API"
},
"consumer": {
"name": "Consumer"
},
"interactions": [
{
"description": "a request to retrieve all events",