// 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; }
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); } }
protected WriteRepository(WriteDbContext dbContext) =>
public GetBookListItemFetchHandler(WriteDbContext dbContext) { _dbContext = dbContext; }
public WriteQuestionRepository(WriteDbContext writeContext) => _writeContext = writeContext ?? throw new ArgumentNullException(nameof(_writeContext));
public UserLocationWriteRepository(WriteDbContext context) { this.context = context; dbSet = context.UserLocations; }
public WriteDbContextBasedRepository(WriteDbContext dbContext) { _dbContext = dbContext; }
public GetListsByIdsFetchHandler(WriteDbContext writeDbContext) { _writeDbContext = writeDbContext; }
public GetItemsByBookAndListIdsFetchHandler(WriteDbContext dbContext) { _dbContext = dbContext; }
public TransactionWriteOnlyRepository(WriteDbContext writeDbContext) { this.writeDbContext = writeDbContext ?? throw new ArgumentNullException(nameof(writeDbContext)); }
public HotToursWriteRepository(WriteDbContext dbContext) : base(dbContext) { }
public DbSeeder(WriteDbContext dbContext) =>
public GetItemsByListIdFetchHandler(WriteDbContext dbContext) { _dbContext = dbContext; }
public MiningWriteOnlyRepository(WriteDbContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); }
public TransactionsRepository(WriteDbContext dbContext) : base(dbContext) { }
public GetPrivateListByUserIdFetchHandler(WriteDbContext dbContext) { _dbContext = dbContext; }
public ChatWriteRepository(WriteDbContext dbContext) : base(dbContext) { }
public GetUserByLoginFetchHandler(WriteDbContext dbContext) { _dbContext = dbContext; }
public MinersMaterializer(WriteDbContext writeDbContext, ReadDbContext readDbContext) { this.writeDbContext = writeDbContext ?? throw new ArgumentNullException(nameof(writeDbContext)); this.readDbContext = readDbContext ?? throw new ArgumentNullException(nameof(readDbContext)); }