Esempio n. 1
0
        static IApiContainer CreateContainer(HttpConfiguration configuration, IDomainServiceResolver domainServiceResolver)
        {
            var windsorContainer = new WindsorContainer();

            return(new DefaultApiContainer(configuration, windsorContainer, _resourceSpecsAssembly,
                                           _resourceStateProvidersAssembly, domainServiceResolver));
        }
Esempio n. 2
0
        public static void Initialize(
            HttpConfiguration config,
            IApiContainer container = null,
            IDomainServiceResolver domainServiceResolver = null,
            Action <HttpConfiguration> postConfigure     = null,
            bool initializeHelpPage = true) // TODO: refactor to instance BootStrapper class and make InitializeDocumentationApplication() public; pass all parameter in a constructor or factory
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            var hconfig = SetConfiguration(config, postConfigure);

            container = container ?? CreateContainer(config, domainServiceResolver);
            container.RegisterDependencies();
            SetupDependencyResolver(config, container);

            ConfigureFormatters(config, container);
            ConfigureMessageHandlers(config.MessageHandlers, container);
            ConfigureFilters(config.Filters, container);

            container.Resolve <IWebApiConfigurator>()
            .Configure(config, hconfig);

            if (initializeHelpPage)
            {
                InitializeDocumentationApplication(config, container);
            }
        }
Esempio n. 3
0
 public Entity(IEntityDelegator entityDelegator,
               IDomainServiceResolver resolver,
               Lazy <IEnumerable <EntityBehavior> > deferredBehaviors)
 {
     _entityDelegator   = entityDelegator;
     _resolver          = resolver;
     _deferredBehaviors = deferredBehaviors;
 }
Esempio n. 4
0
 public DefaultApiContainer(HttpConfiguration configuration, IWindsorContainer windsorContainer,
                            Assembly resourceSpecsAssembly,
                            Assembly resourceStateProvidersAssembly,
                            IDomainServiceResolver domainServiceResolver = null)
     : base(configuration, windsorContainer)
 {
     _domainServiceResolver          = domainServiceResolver;
     _resourceSpecsAssembly          = resourceSpecsAssembly;
     _resourceStateProvidersAssembly = resourceStateProvidersAssembly;
 }
Esempio n. 5
0
        public DomainServicesInstaller(IDomainServiceResolver customDomainServiceResolver, Assembly apiDomainServicesAssembly,
                                       Assembly apiDomainServiceInterfacesAssembly)
        {
            if (apiDomainServicesAssembly == null)
            {
                throw new ArgumentNullException("apiDomainServicesAssembly");
            }
            if (apiDomainServiceInterfacesAssembly == null)
            {
                throw new ArgumentNullException("apiDomainServiceInterfacesAssembly");
            }

            _customDomainServiceResolver        = customDomainServiceResolver;
            _apiDomainServicesAssembly          = apiDomainServicesAssembly;
            _apiDomainServiceInterfacesAssembly = apiDomainServiceInterfacesAssembly;
        }
Esempio n. 6
0
        static IApiContainer CreateContainer(HttpConfiguration configuration, IDomainServiceResolver domainServiceResolver)
        {
            var windsorContainer = new WindsorContainer();

            return(new DefaultApiContainer(configuration, windsorContainer, domainServiceResolver));
        }
Esempio n. 7
0
 public DefaultApiContainer(HttpConfiguration configuration, IWindsorContainer windsorContainer, IDomainServiceResolver domainServiceResolver = null)
     : base(configuration, windsorContainer)
 {
     _domainServiceResolver = domainServiceResolver;
 }
 public DomainEntityFactory(IDomainServiceResolver resolver)
 {
     Check.NotNull(resolver, nameof(resolver));
     _resolver = resolver;
 }