public AnswerRepository( StackOverHeadQuestionDbContext dbContext, IAnswerEntityModelFactory convert, ICommentEntityToModelFactory convertComment) : base(dbContext, convert) { _convertComment = convertComment; }
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); }