Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public void ConfigureServices(IServiceCollection services)
{
if (CurrentEnvironment.IsDevelopment()) // Here is where we check
{
services.AddDbContext<AppDbContext>(
options => options.UseInMemoryDatabase()); // And we ask it to use the InMemoryDatabase Option
}
else
{
services.AddDbContext<AppDbContext>(
options => options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
}
services.AddScoped<ICreditCardApplicationRepository,
EntityFrameworkCreditCardApplicationRepository>();
services.AddMvc();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.