コード例 #1
0
ファイル: Startup.cs プロジェクト: joeipe/MicroDojo
        // 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");
            });
        }
コード例 #2
0
 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());
 }
コード例 #3
0
 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;
        }
コード例 #5
0
        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;
 }
コード例 #8
0
 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));
 }
コード例 #18
0
 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));
 }