Pomona.RequestProcessing.HandlerMethod.Match C# (CSharp) Method

Match() public method

public Match ( HttpMethod method, PathNodeType nodeType, TypeSpec resourceType ) : RouteAction
method HttpMethod
nodeType PathNodeType
resourceType TypeSpec
return Pomona.Routing.RouteAction
        public RouteAction Match(HttpMethod method, PathNodeType nodeType, TypeSpec resourceType)
        {
            switch (nodeType)
            {
                case PathNodeType.Collection:
                    return MatchCollectionNodeRequest(method, (ResourceType)resourceType);
                case PathNodeType.Resource:
                    if (!MethodInfo.Name.StartsWith(method.ToString()))
                        return null;
                    return MatchResourceNodeRequest(method, (ResourceType)resourceType);
            }
            return null;
        }

Usage Example

Example #1
0
 public void Match_ChildResource_Requires_ParentResource()
 {
     var methodObject = new HandlerMethod(typeof(HandlerMethodTests).GetMethod("QueryPlanetarySystems"),
                                          TypeMapper);
     Assert.That(
         methodObject.Match(HttpMethod.Get,
                            PathNodeType.Collection,
                            TypeMapper.FromType(typeof(PlanetarySystem))),
         Is.Null);
 }
All Usage Examples Of Pomona.RequestProcessing.HandlerMethod::Match