Exemplo n.º 1
0
 public AnswerRepository(
     StackOverHeadQuestionDbContext dbContext,
     IAnswerEntityModelFactory convert,
     ICommentEntityToModelFactory convertComment)
     : base(dbContext, convert)
 {
     _convertComment = convertComment;
 }
Exemplo n.º 2
0
        public static IHost InitializeDataBase(this IHost host)
        {
            var serviceScopeFactory = host.Services;

            using var scope = serviceScopeFactory.CreateScope();
            var services = scope.ServiceProvider;

            StackOverHeadQuestionDbContext stockDB = services
                                                     .GetRequiredService <StackOverHeadQuestionDbContext>();

            stockDB.Database.Migrate();

            StackOverHeadAuthDbContext authDB = services
                                                .GetRequiredService <StackOverHeadAuthDbContext>();

            authDB.Database.Migrate();

            return(host);
        }