public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var changeSetPreparer      = new TestChangeSetInitializer();
                var submitExecutor         = new TestSubmitExecutor();
                var queryExpressionSourcer = new TestQueryExpressionSourcer();

                ApiBase.ConfigureApi(apiType, services);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);
                services.AddService <IQueryExpressionSourcer>((sp, next) => queryExpressionSourcer);

                services.AddService <ISomeService>((sp, next) => new SomeService
                {
                    Value = 1
                })
                .AddService <ISomeService, SomeService3>()
                .AddSingleton(new SomeService
                {
                    Value = 2
                })
                .MakeTransient <ISomeService>()
                .AddService <string>((sp, next) => { return("0"); })
                .MakeTransient <string>();
                return(services);
            }
            public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var changeSetPreparer = new TestChangeSetInitializer();
                var submitExecutor    = new TestSubmitExecutor();

                ApiBase.ConfigureApi(apiType, services);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);
                var i = 0;

                services.AddService <ISomeService>((sp, next) => new SomeService
                {
                    Inner = next,
                    Value = i++
                })
                .AddService <ISomeService>((sp, next) => new SomeService
                {
                    Inner = next,
                    Value = i++
                })
                .AddService <ISomeService>((sp, next) => new SomeService
                {
                    Inner = next,
                    Value = i++
                })
                .AddService <ISomeService>((sp, next) => new SomeService
                {
                    Inner = next,
                    Value = i++
                })
                .AddService <ISomeService, SomeService>();
                return(services);
            }
            public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var changeSetPreparer      = new TestChangeSetInitializer();
                var submitExecutor         = new TestSubmitExecutor();
                var queryExpressionSourcer = new TestQueryExpressionSourcer();

                ApiBase.ConfigureApi(apiType, services);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);
                services.AddService <IQueryExpressionSourcer>((sp, next) => queryExpressionSourcer);

                return(services);
            }
Example #4
0
            public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var changeSetPreparer = new TestChangeSetInitializer();
                var submitExecutor    = new TestSubmitExecutor();

                ApiBase.ConfigureApi(apiType, services);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);
                services.AddService <IServiceA>((sp, next) => serviceA);
                services.AddService <IServiceB>((sp, next) => serviceB);
                services.AddService <IServiceB, ServiceB>();
                services.AddSingleton(new ServiceB());
                return(services);
            }
Example #5
0
            protected override IServiceCollection ConfigureApi(IServiceCollection services)
            {
                var modelBuilder      = new TestModelBuilder();
                var modelMapper       = new TestModelMapper();
                var querySourcer      = new TestQuerySourcer();
                var changeSetPreparer = new TestChangeSetPreparer();
                var submitExecutor    = new TestSubmitExecutor();

                services.CutoffPrevious <IQueryExecutor>(DefaultQueryExecutor.Instance);
                services.CutoffPrevious <IModelBuilder>(modelBuilder);
                services.CutoffPrevious <IModelMapper>(modelMapper);
                services.CutoffPrevious <IQueryExpressionSourcer>(querySourcer);
                services.CutoffPrevious <IChangeSetPreparer>(changeSetPreparer);
                services.CutoffPrevious <ISubmitExecutor>(submitExecutor);

                return(services);
            }
Example #6
0
            protected override IServiceCollection ConfigureApi(IServiceCollection services)
            {
                var modelBuilder      = new TestModelBuilder();
                var modelMapper       = new TestModelMapper();
                var querySourcer      = new TestQuerySourcer();
                var changeSetPreparer = new TestChangeSetInitializer();
                var submitExecutor    = new TestSubmitExecutor();

                services.AddCoreServices(this.GetType());
                services.AddService <IModelBuilder>((sp, next) => modelBuilder);
                services.AddService <IModelMapper>((sp, next) => modelMapper);
                services.AddService <IQueryExpressionSourcer>((sp, next) => querySourcer);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);

                return(services);
            }
Example #7
0
            public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var changeSetPreparer      = new TestChangeSetInitializer();
                var submitExecutor         = new TestSubmitExecutor();
                var queryExpressionSourcer = new TestQueryExpressionSourcer();

                ApiBase.ConfigureApi(apiType, services);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);
                services.AddService <IQueryExpressionSourcer>((sp, next) => queryExpressionSourcer);
                var q1 = new ServiceB("q1Pre", "q1Post");
                var q2 = new ServiceB("q2Pre", "q2Post");

                services.AddService <IServiceB>((sp, next) => q1)
                .AddService <IServiceB>((sp, next) =>
                {
                    q2.InnerHandler = next;
                    return(q2);
                });

                return(services);
            }
            public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var changeSetPreparer      = new TestChangeSetInitializer();
                var submitExecutor         = new TestSubmitExecutor();
                var queryExpressionSourcer = new TestQueryExpressionSourcer();

                ApiBase.ConfigureApi(apiType, services);
                services.AddService <IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService <ISubmitExecutor>((sp, next) => submitExecutor);
                services.AddService <IQueryExpressionSourcer>((sp, next) => queryExpressionSourcer);

                services.AddService <IModelBuilder>((sp, next) => new TestModelProducer());
                services.AddService <IModelBuilder>((sp, next) => new TestModelExtender(2)
                {
                    InnerHandler = next,
                });
                services.AddService <IModelBuilder>((sp, next) => new TestModelExtender(3)
                {
                    InnerHandler = next,
                });

                return(services);
            }
Example #9
0
            public static new IServiceCollection ConfigureApi(Type apiType, IServiceCollection services)
            {
                var modelBuilder = new TestModelBuilder();
                var modelMapper = new TestModelMapper();
                var querySourcer = new TestQuerySourcer();
                var changeSetPreparer = new TestChangeSetInitializer();
                var submitExecutor = new TestSubmitExecutor();

                services.AddCoreServices(apiType);
                services.AddService<IModelBuilder>((sp, next) => modelBuilder);
                services.AddService<IModelMapper>((sp, next) => modelMapper);
                services.AddService<IQueryExpressionSourcer>((sp, next) => querySourcer);
                services.AddService<IChangeSetInitializer>((sp, next) => changeSetPreparer);
                services.AddService<ISubmitExecutor>((sp, next) => submitExecutor);

                return services;
            }
Example #10
0
            protected override IServiceCollection ConfigureApi(IServiceCollection services)
            {
                var modelBuilder = new TestModelBuilder();
                var modelMapper = new TestModelMapper();
                var querySourcer = new TestQuerySourcer();
                var changeSetPreparer = new TestChangeSetPreparer();
                var submitExecutor = new TestSubmitExecutor();

                services.CutoffPrevious<IQueryExecutor>(DefaultQueryExecutor.Instance);
                services.CutoffPrevious<IModelBuilder>(modelBuilder);
                services.CutoffPrevious<IModelMapper>(modelMapper);
                services.CutoffPrevious<IQueryExpressionSourcer>(querySourcer);
                services.CutoffPrevious<IChangeSetPreparer>(changeSetPreparer);
                services.CutoffPrevious<ISubmitExecutor>(submitExecutor);

                return services;
            }