示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, WriteDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                dbContext.Database.Migrate();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "Warrior API V1");
            });
        }
 public WriteDbContextTest()
 {
     writeDbContext = WriteBookStoreContext.SqlServerDocker();
     fakerAuthor    = new Faker <Author>()
                      .RuleFor(a => a.FirstName, f => f.Name.FirstName())
                      .RuleFor(a => a.LastName, f => f.Name.LastName());
 }
 public UnitOfWork(
     WriteDbContext dbContext,
     ILogger <UnitOfWork> logger)
 {
     _dbContext   = dbContext;
     _transaction = dbContext.Database.BeginTransaction();
     _logger      = logger;
 }
示例#4
0
        public UnitOfWork(
            WriteDbContext dbContext,
            IChatWriteRepository chatWriteRepository,
            IHotToursWriteRepository hotToursWriteRepository,
            ILogger <UnitOfWork> logger)
        {
            _dbContext   = dbContext;
            _transaction = dbContext.Database.BeginTransaction();
            _logger      = logger;

            ChatWriteRepository     = chatWriteRepository;
            HotToursWriteRepository = hotToursWriteRepository;
        }
        static void Main(string[] args)
        {
            try
            {
                var connectionString = ConfigurationProvider.DbConnectionString;
                using (var db = new WriteDbContext(connectionString))
                {
                    Console.WriteLine("Starting migrations for " + connectionString);
                    db.Database.Migrate();
                }

                Console.WriteLine("Migrations completed successfully");
            }
            catch (Exception e)
            {
                Console.WriteLine("Unexpected Exception: " + e.Message);
                Environment.Exit(ERROR_UNEXPECTED_EXCEPTION);
            }
        }
示例#6
0
 protected WriteRepository(WriteDbContext dbContext) =>
示例#7
0
 public GetBookListItemFetchHandler(WriteDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public WriteQuestionRepository(WriteDbContext writeContext)
 => _writeContext = writeContext ?? throw new ArgumentNullException(nameof(_writeContext));
示例#9
0
 public UserLocationWriteRepository(WriteDbContext context)
 {
     this.context = context;
     dbSet        = context.UserLocations;
 }
示例#10
0
 public WriteDbContextBasedRepository(WriteDbContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#11
0
 public GetListsByIdsFetchHandler(WriteDbContext writeDbContext)
 {
     _writeDbContext = writeDbContext;
 }
示例#12
0
 public GetItemsByBookAndListIdsFetchHandler(WriteDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public TransactionWriteOnlyRepository(WriteDbContext writeDbContext)
 {
     this.writeDbContext = writeDbContext ?? throw new ArgumentNullException(nameof(writeDbContext));
 }
示例#14
0
 public HotToursWriteRepository(WriteDbContext dbContext)
     : base(dbContext)
 {
 }
示例#15
0
 public DbSeeder(WriteDbContext dbContext) =>
示例#16
0
 public GetItemsByListIdFetchHandler(WriteDbContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#17
0
 public MiningWriteOnlyRepository(WriteDbContext context)
 {
     this.context = context ?? throw new ArgumentNullException(nameof(context));
 }
 public TransactionsRepository(WriteDbContext dbContext)
     : base(dbContext)
 {
 }
示例#19
0
 public GetPrivateListByUserIdFetchHandler(WriteDbContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#20
0
 public ChatWriteRepository(WriteDbContext dbContext) : base(dbContext)
 {
 }
示例#21
0
 public GetUserByLoginFetchHandler(WriteDbContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#22
0
 public MinersMaterializer(WriteDbContext writeDbContext, ReadDbContext readDbContext)
 {
     this.writeDbContext = writeDbContext ?? throw new ArgumentNullException(nameof(writeDbContext));
     this.readDbContext  = readDbContext ?? throw new ArgumentNullException(nameof(readDbContext));
 }