public SpecificationService(
     Configuration configuration,
     BehaviorSource behaviors,
     ITypeDescriptorCache typeCache,
     IDescriptionConvention <BehaviorChain, ModuleDescription> moduleConvention,
     IDescriptionConvention <BehaviorChain, ResourceDescription> resourceConvention,
     IDescriptionConvention <BehaviorChain, EndpointDescription> endpointConvention,
     IDescriptionConvention <PropertyInfo, MemberDescription> memberConvention,
     IDescriptionConvention <BehaviorChain, List <StatusCodeDescription> > statusCodeConvention,
     IDescriptionConvention <BehaviorChain, List <HeaderDescription> > headerConvention,
     IDescriptionConvention <BehaviorChain, List <MimeTypeDescription> > mimeTypeConvention,
     TypeGraphFactory typeGraphFactory,
     BodyDescriptionFactory bodyDescriptionFactory,
     OptionFactory optionFactory)
 {
     _configuration          = configuration;
     _behaviors              = behaviors;
     _typeCache              = typeCache;
     _moduleConvention       = moduleConvention;
     _resourceConvention     = resourceConvention;
     _endpointConvention     = endpointConvention;
     _memberConvention       = memberConvention;
     _statusCodeConvention   = statusCodeConvention;
     _typeGraphFactory       = typeGraphFactory;
     _bodyDescriptionFactory = bodyDescriptionFactory;
     _optionFactory          = optionFactory;
     _headerConvention       = headerConvention;
     _mimeTypeConvention     = mimeTypeConvention;
 }
 public SpecificationService(
     Configuration configuration, 
     BehaviorSource behaviors,
     ITypeDescriptorCache typeCache,
     IDescriptionConvention<BehaviorChain, ModuleDescription> moduleConvention,
     IDescriptionConvention<BehaviorChain, ResourceDescription> resourceConvention,
     IDescriptionConvention<BehaviorChain, EndpointDescription> endpointConvention,
     IDescriptionConvention<PropertyInfo, MemberDescription> memberConvention,
     IDescriptionConvention<BehaviorChain, List<StatusCodeDescription>> statusCodeConvention,
     IDescriptionConvention<BehaviorChain, List<HeaderDescription>> headerConvention,
     IDescriptionConvention<BehaviorChain, List<MimeTypeDescription>> mimeTypeConvention,
     TypeGraphFactory typeGraphFactory,
     BodyDescriptionFactory bodyDescriptionFactory,
     OptionFactory optionFactory)
 {
     _configuration = configuration;
     _behaviors = behaviors;
     _typeCache = typeCache;
     _moduleConvention = moduleConvention;
     _resourceConvention = resourceConvention;
     _endpointConvention = endpointConvention;
     _memberConvention = memberConvention;
     _statusCodeConvention = statusCodeConvention;
     _typeGraphFactory = typeGraphFactory;
     _bodyDescriptionFactory = bodyDescriptionFactory;
     _optionFactory = optionFactory;
     _headerConvention = headerConvention;
     _mimeTypeConvention = mimeTypeConvention;
 }
Exemplo n.º 3
0
 public TypeGraphFactory(
     Configuration configuration,
     ITypeDescriptorCache typeCache,
     IDescriptionConvention <Type, TypeDescription> typeConvention,
     IDescriptionConvention <PropertyInfo, MemberDescription> memberConvention,
     OptionFactory optionFactory)
 {
     _configuration    = configuration;
     _typeCache        = typeCache;
     _memberConvention = memberConvention;
     _optionFactory    = optionFactory;
     _typeConvention   = typeConvention;
 }
Exemplo n.º 4
0
 public TypeGraphFactory(
     Configuration configuration, 
     ITypeDescriptorCache typeCache,
     IDescriptionConvention<Type, TypeDescription> typeConvention,
     IDescriptionConvention<PropertyInfo, MemberDescription> memberConvention,
     OptionFactory optionFactory)
 {
     _configuration = configuration;
     _typeCache = typeCache;
     _memberConvention = memberConvention;
     _optionFactory = optionFactory;
     _typeConvention = typeConvention;
 }
Exemplo n.º 5
0
        public static FubuMVC.Swank.Specification.Specification GetSpec(Action<Swank> configure = null)
        {
            var graph = Behavior.BuildGraph().AddActionsInThisNamespace();
            var moduleConvention = new ModuleConvention(new MarkerConvention<ModuleDescription>());

            var resourceConvention = new ResourceConvention(
                new MarkerConvention<ResourceDescription>(),
                new BehaviorSource(graph, Swank.CreateConfig(x => x.AppliesToThisAssembly().Where(ActionFilter))));

            var configuration = Swank.CreateConfig(x =>
                {
                    x.AppliesToThisAssembly().Where(ActionFilter).WithEnumFormat(EnumFormat.AsString);
                    if (configure != null) configure(x);
                });
            var typeCache = new TypeDescriptorCache();
            var memberConvention = new MemberConvention();
            var optionFactory = new OptionFactory(configuration,
                new EnumConvention(), new OptionConvention());
            var specBuilder = new FubuMVC.Swank.Specification.SpecificationService(
                configuration,
                new BehaviorSource(graph, configuration),
                typeCache,
                moduleConvention,
                resourceConvention,
                new EndpointConvention(),
                memberConvention,
                new StatusCodeConvention(),
                new HeaderConvention(),
                new MimeTypeConvention(),
                new TypeGraphFactory(
                    configuration, 
                    typeCache,
                    new TypeConvention(configuration), 
                    memberConvention,
                    optionFactory), 
                new BodyDescriptionFactory(configuration),
                new OptionFactory(configuration,
                    new EnumConvention(), 
                    new OptionConvention()));
            return specBuilder.Generate();
        }