示例#1
0
 public static ISystemBuilder UseFileSystem <T>(this ISystemBuilder builder, string key) where T : class, IFileSystem
 {
     return(builder.Use <IFileSystem>(options => options
                                      .With <T>()
                                      .HavingKey(key)
                                      .InSystemScope()));
 }
示例#2
0
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use <IObjectManager>(options => options
                                  .With <SchemaManager>()
                                  .HavingKey(DbObjectType.Schema)
                                  .InTransactionScope());
 }
        private static void OnBuild(ISystemBuilder builder)
        {
            builder
            .Use <IObjectManager>(options => options
                                  .With <RoutineManager>()
                                  .HavingKey(DbObjectType.Routine)
                                  .InTransactionScope())
            .Use <IRoutineResolver>(options => options
                                    .With <SystemFunctionsProvider>()
                                    .InDatabaseScope())
            .Use <IRoutineResolver>(options => options
                                    .With <RoutineManager>()
                                    .InTransactionScope())
            .Use <ITableContainer>(options => options
                                   .With <RoutinesTableContainer>()
                                   .InTransactionScope());

            //builder.Use<ITableCompositeSetupCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());

            //builder.Use<IDatabaseCreateCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());
        }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use<IObjectManager>(options => options
         .With<SchemaManager>()
         .HavingKey(DbObjectType.Schema)
         .InTransactionScope());
 }
示例#5
0
 public static ISystemBuilder UseStoreDataFactory <T>(this ISystemBuilder builder, string key)
     where T : class, IStoreDataFactory
 {
     return(builder.Use <IStoreDataFactory>(options => options
                                            .With <T>()
                                            .HavingKey(key)
                                            .InDatabaseScope()));
 }
        public static ISystemBuilder Use <TService>(this ISystemBuilder builder, Action <IServiceUseConfiguration <TService> > options)
        {
            var provider = new ServiceUseConfigurationProvider <TService>();

            options(provider);

            return(builder.Use(provider.Options));
        }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use<IObjectManager>(options => options
             .With<ViewManager>()
             .InTransactionScope()
             .HavingKey(DbObjectType.View))
         .Use<ITableContainer>(options => options
             .With<ViewTableContainer>()
             .InTransactionScope());
 }
示例#8
0
 private static void OnBuild(ISystemBuilder builder)
 {
     builder.Use <IObjectManager>(options => options
                                  .With <ViewManager>()
                                  .InTransactionScope()
                                  .HavingKey(DbObjectType.View))
     .Use <ITableContainer>(options => options
                            .With <ViewTableContainer>()
                            .InTransactionScope());
 }
示例#9
0
 public void OnBuild(ISystemBuilder builder)
 {
     builder.Use <IObjectManager>(options => options
                                  .With <ViewManager>()
                                  .InTransactionScope()
                                  .HavingKey(DbObjectType.View))
     .Use <ITableCompositeCreateCallback>(options => options
                                          .With <ViewsInit>()
                                          .HavingKey("Views")
                                          .InTransactionScope())
     .Use <ITableContainer>(options => options
                            .With <ViewTableContainer>()
                            .InTransactionScope());
 }
示例#10
0
        protected override void RegisterServices(ISystemBuilder builder)
        {
            var mock = new Mock <IIndexFactory>();

            mock.Setup(obj => obj.CreateIndex(It.IsAny <ColumnIndexContext>()))
            .Returns <ColumnIndexContext>(context => {
                var cmock = new Mock <ColumnIndex>(context.Table, context.ColumnOffset);
                return(cmock.Object);
            });
            mock.Setup(obj => obj.HandlesIndexType(It.IsAny <string>()))
            .Returns(true);

            builder.Use(mock.Object);
        }
示例#11
0
 public void OnBuild(ISystemBuilder builder)
 {
     builder.Use<IObjectManager>(options => options
             .With<ViewManager>()
             .InTransactionScope()
             .HavingKey(DbObjectType.View))
         .Use<ITableCompositeCreateCallback>(options => options
             .With<ViewsInit>()
             .HavingKey("Views")
             .InTransactionScope())
         .Use<ITableContainer>(options => options
             .With<ViewTableContainer>()
             .InTransactionScope());
 }
示例#12
0
        public void OnBuild(ISystemBuilder builder)
        {
            builder
                .Use<IUserManager>(options => options
                    .With<UserManager>()
                    .InSessionScope())
                //.Use<IDatabaseCreateCallback>(options => options
                //	.With<UsersInit>()
                //	.InQueryScope())
                .Use<IPrivilegeManager>(options => options
                    .With<PrivilegeManager>()
                    .InSessionScope())
                .Use<ITableCompositeSetupCallback>(options => options
                    .With<PrivilegesInit>()
                    .InQueryScope())
                .Use<IUserIdentifier>(options => options
                    .With<ClearTextUserIdentifier>());

            // TODO: Add the system callbacks

            #if !PCL
            builder.Use<IUserIdentifier, Pkcs12UserIdentifier>();
            #endif
        }
        public void OnBuild(ISystemBuilder builder)
        {
            builder
            .Use <IUserManager>(options => options
                                .With <UserManager>()
                                .InSessionScope())
            //.Use<IDatabaseCreateCallback>(options => options
            //	.With<UsersInit>()
            //	.InQueryScope())
            .Use <IPrivilegeManager>(options => options
                                     .With <PrivilegeManager>()
                                     .InSessionScope())
            .Use <ITableCompositeSetupCallback>(options => options
                                                .With <PrivilegesInit>()
                                                .InQueryScope())
            .Use <IUserIdentifier>(options => options
                                   .With <ClearTextUserIdentifier>());

            // TODO: Add the system callbacks

#if !PCL
            builder.Use <IUserIdentifier, Pkcs12UserIdentifier>();
#endif
        }
示例#14
0
 private static void OnBuild(ISystemBuilder builder)
 {
     builder
         .Use<IObjectManager>(options => options
             .With<TypeManager>()
             .HavingKey(DbObjectType.Type)
             .InTransactionScope())
         .Use<ITableContainer>(options => options
             .With<TypesTableContainer>()
             .InTransactionScope())
         //.Use<ITableCompositeCreateCallback>(options => options
         //	.With<TypesInit>()
         //	.InTransactionScope())
         .Use<ITypeResolver>(options => options
             .With<TypeManager>()
             .InTransactionScope())
         .Use<IRoutineResolver>(options => options
             .With<TypeManager>()
             .InTransactionScope());
 }
 private static void OnBuild(ISystemBuilder builder)
 {
     builder
     .Use <IObjectManager>(options => options
                           .With <TypeManager>()
                           .HavingKey(DbObjectType.Type)
                           .InTransactionScope())
     .Use <ITableContainer>(options => options
                            .With <TypesTableContainer>()
                            .InTransactionScope())
     //.Use<ITableCompositeCreateCallback>(options => options
     //	.With<TypesInit>()
     //	.InTransactionScope())
     .Use <ITypeResolver>(options => options
                          .With <TypeManager>()
                          .InTransactionScope())
     .Use <IRoutineResolver>(options => options
                             .With <TypeManager>()
                             .InTransactionScope());
 }
示例#16
0
        protected override void RegisterServices(ISystemBuilder builder)
        {
            var mock = new Mock<IIndexFactory>();
            mock.Setup(obj => obj.CreateIndex(It.IsAny<ColumnIndexContext>()))
                .Returns<ColumnIndexContext>(context => {
                    var cmock = new Mock<ColumnIndex>(context.Table, context.ColumnOffset);
                    return cmock.Object;
                });
            mock.Setup(obj => obj.HandlesIndexType(It.IsAny<string>()))
                .Returns(true);

            builder.Use(mock.Object);
        }
 public static ISystemBuilder UseFeature <TFeature>(this ISystemBuilder builder, TFeature feature) where TFeature : class, ISystemFeature
 {
     return(builder.Use <ISystemFeature>(options => options.With(feature)));
 }
 public static ISystemBuilder Use <TService>(this ISystemBuilder builder, object key, TService service) where TService : class
 {
     return(builder.Use <TService>(options => options.With(service).HavingKey(key)));
 }
 public static ISystemBuilder Use <TService, TImplementation>(this ISystemBuilder builder)
     where TImplementation : class, TService
 {
     return(builder.Use <TService, TImplementation>(null));
 }
 public static ISystemBuilder Use <TService, TImplementation>(this ISystemBuilder builder, object key)
     where TImplementation : class, TService
 {
     return(builder.Use <TService>(config => config.With <TImplementation>().HavingKey(key)));
 }
 public static ISystemBuilder Use <TService>(this ISystemBuilder builder) where TService : class
 {
     return(builder.Use <TService>((object)null));
 }
 public static ISystemBuilder Use <TService>(this ISystemBuilder builder, object key) where TService : class
 {
     return(builder.Use <TService>(config => config.ToSelf().HavingKey(key)));
 }
 public static ISystemBuilder UseSqlCompiler <T>(this ISystemBuilder builder) where T : class, ISqlCompiler
 {
     return(builder.Use <ISqlCompiler>(options => options.With <T>().InSystemScope()));
 }
 public static ISystemBuilder UseSqlCompiler(this ISystemBuilder builder, ISqlCompiler compiler)
 {
     return(builder.Use <ISqlCompiler>(options => options.With(compiler).InSystemScope()));
 }
 public static ISystemBuilder UseQueryPlanner <T>(this ISystemBuilder builder) where T : class, IQueryPlanner
 {
     return(builder.Use <IQueryPlanner>(options => options.With <T>().InSystemScope()));
 }
 public static ISystemBuilder UseVariables(this ISystemBuilder builder)
 {
     return(builder.Use <TableCellCache>(options => options
                                         .With <TableCellCache>()
                                         .InSystemScope()));
 }
示例#27
0
        private static void OnBuild(ISystemBuilder builder)
        {
            builder
                .Use<IObjectManager>(options => options
                    .With<RoutineManager>()
                    .HavingKey(DbObjectType.Routine)
                    .InTransactionScope())
                .Use<IRoutineResolver>(options => options
                    .With<SystemFunctionsProvider>()
                    .InDatabaseScope())
                .Use<IRoutineResolver>(options => options
                    .With<RoutineManager>()
                    .InTransactionScope())
                .Use<ITableContainer>(options => options
                    .With<RoutinesTableContainer>()
                    .InTransactionScope());

            //builder.Use<ITableCompositeSetupCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());

            //builder.Use<IDatabaseCreateCallback>(options => options
            //	.With<RoutinesInit>()
            //	.InQueryScope());
        }
 public static ISystemBuilder UseStatementCache <T>(this ISystemBuilder builder) where T : class, IStatementCache
 {
     return(builder.Use <IStatementCache>(options => options.With <T>().InSystemScope()));
 }
 public static ISystemBuilder UseConfiguration <T>(this ISystemBuilder builder, T configuration) where T : class, IConfiguration
 {
     return(builder.Use <IConfiguration>(options => options.With(configuration).Replace()));
 }