public static ApiAppContext GetApiAppContext() { var optiones = new DbContextOptionsBuilder <ApiAppContext>().UseInMemoryDatabase(databaseName: "AppDb").Options; var dbContext = new ApiAppContext(optiones); dbContext.Database.EnsureDeleted(); dbContext.Database.EnsureCreated(); return(dbContext); }
public UserController(ApiAppContext context) { apiContext = context; apiContext.Database.EnsureCreated(); }