Last active
November 3, 2016 01:01
-
-
Save dcomartin/a4310da2c97197448f63041213ed8b94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.Configure<AppSettings>(Configuration.GetSection("AppSettings")); | |
// Add EF services to the services container | |
if (_platform.UseInMemoryStore) | |
{ | |
services.AddDbContext<MusicStoreContext>(options => | |
options.UseInMemoryDatabase()); | |
} | |
else | |
{ | |
services.AddDbContext<MusicStoreContext>(options => | |
options.UseSqlServer(Configuration[StoreConfig.ConnectionStringKey.Replace("__", ":")])); | |
} | |
// Add Identity services to the services container | |
services.AddIdentity<ApplicationUser, IdentityRole>(options => | |
{ | |
options.Cookies.ApplicationCookie.AccessDeniedPath = "/Home/AccessDenied"; | |
}) | |
.AddEntityFrameworkStores<MusicStoreContext>() | |
.AddDefaultTokenProviders(); | |
services.AddMediatR(typeof(Startup).GetTypeInfo().Assembly); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment