public BehaviorChain()
        {
            Authorization = new AuthorizationNode();
            UrlCategory = new UrlCategory();

            _output = new Lazy<OutputNode>(() =>
            {
                var outputType = ResourceType();
                if (outputType == null || outputType == typeof (void))
                    throw new InvalidOperationException(
                        "Cannot use the OutputNode if the BehaviorChain does not have at least one Action with output");

                return new OutputNode(outputType);
            });

            _input = new Lazy<InputNode>(() =>
            {
                var inputType = InputType();
                if (inputType == null)
                    throw new InvalidOperationException(
                        "Cannot use the InputNode if the BehaviorChain does not have at least one behavior that requires an input type");

                return new InputNode(inputType);
            });
        }
Beispiel #2
0
        public RoutedChain(IRouteDefinition route)
        {
            if (route == null)
            {
                throw new ArgumentNullException("route");
            }

            UrlCategory = new UrlCategory();
            Route = route;
        }
Beispiel #3
0
 public BehaviorChain()
 {
     Authorization = new AuthorizationNode();
     UrlCategory   = new UrlCategory();
 }