public override void Map(Routing.Route route, IContainer container)
        {
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            route.RestrictByMethods(_methods);
        }
Exemplo n.º 2
0
        public void Map(Type type, MethodInfo method, Routing.Route route, IContainer container)
        {
            type.ThrowIfNull("type");
            method.ThrowIfNull("method");
            route.ThrowIfNull("route");
            container.ThrowIfNull("container");

            HttpMethod httpMethod;
            string     methodName = method.Name.TrimEnd("Async");

            if (Enum <HttpMethod> .TryParse(methodName, true, out httpMethod))
            {
                route.RestrictByMethods(httpMethod);
            }
        }