private static void EnsureDatabaseCreated(IServiceProvider serviceProvider) { var contextOptions = serviceProvider.GetService <DbContextOptions <AccountContext> >(); using (var context = new AccountContext(contextOptions)) { context.Database.EnsureCreated(); } }
public AccountDataGateway(AccountContext context) { _context = context; }