示例#1
0
        private static void RegisterSupportDbContextToSqliteInMemoryDb(IIocManager iocManager)
        {
            var builder = new DbContextOptionsBuilder <SupportDbContext>();

            builder.ReplaceService <IEntityMaterializerSource, AbpEntityMaterializerSource>();

            var inMemorySqlite = new SqliteConnection("Data Source=:memory:");

            builder.UseSqlite(inMemorySqlite);

            iocManager.IocContainer.Register(
                Component
                .For <DbContextOptions <SupportDbContext> >()
                .Instance(builder.Options)
                .LifestyleSingleton()
                );

            inMemorySqlite.Open();
            var ctx = new SupportDbContext(builder.Options);

            ctx.Database.EnsureCreated();

            using (var command = ctx.Database.GetDbConnection().CreateCommand())
            {
                command.CommandText = SupportDbContext.TicketViewSql;
                ctx.Database.OpenConnection();

                command.ExecuteNonQuery();
            }
        }
示例#2
0
        private void RegisterSupportDbContextToInMemoryDb(IIocManager iocManager)
        {
            var builder = new DbContextOptionsBuilder <SupportDbContext>();

            var inMemorySqlite = new SqliteConnection("Data Source=:memory:");

            builder.UseSqlite(inMemorySqlite);

            iocManager.IocContainer.Register(
                Component
                .For <DbContextOptions <SupportDbContext> >()
                .Instance(builder.Options)
                .LifestyleSingleton()
                );

            inMemorySqlite.Open();
            var ctx = new SupportDbContext(builder.Options);

            ctx.Database.EnsureCreated();

            using (var command = ctx.Database.GetDbConnection().CreateCommand())
            {
                ctx.Database.OpenConnection();
            }
        }
 public FactBeacukaiService(SupportDbContext _context)
 {
     this.context = _context;
 }
 public ExpenditureGoodsService(SupportDbContext _context)
 {
     this.context = _context;
 }
示例#5
0
 public WIPService(SupportDbContext _context)
 {
     this.context = _context;
 }
示例#6
0
 public MachineMutationService(SupportDbContext _context)
 {
     this.context = _context;
 }
示例#7
0
 public FinishedGoodService(SupportDbContext _context)
 {
     this.context = _context;
 }
示例#8
0
 public ScrapService(SupportDbContext _context)
 {
     this.context = _context;
 }
示例#9
0
 public ViewFactBeacukaiService(SupportDbContext context)
 {
     this.context = context;
 }
 public HOrderService(SupportDbContext _context)
 {
     this.context = _context;
 }
示例#11
0
 public FactItemMutationService(SupportDbContext _context)
 {
     this.context = _context;
 }
 public BeacukaiTempService(SupportDbContext context)
 {
     this.context = context;
 }
 public TraceableOutService(ILocalDbProductionDBContext _dBContext, SupportDbContext _context)
 {
     this.dBContext = _dBContext;
 }