Update music store to handle the new changes in aspnet/WebFx#257 and aspnet/WebFx#259

This commit is contained in:
David Fowler 2014-04-17 00:46:24 -07:00
parent aa7fe89c81
commit c06aa04654
1 changed files with 9 additions and 6 deletions

View File

@ -28,18 +28,21 @@ public class Startup
public static InMemoryUserStore<ApplicationUser> UserStore = new InMemoryUserStore<ApplicationUser>(); public static InMemoryUserStore<ApplicationUser> UserStore = new InMemoryUserStore<ApplicationUser>();
public static InMemoryRoleStore<IdentityRole> RoleStore = new InMemoryRoleStore<IdentityRole>(); public static InMemoryRoleStore<IdentityRole> RoleStore = new InMemoryRoleStore<IdentityRole>();
private static void ConfigureServices(ServiceCollection services)
{
services.AddInstance<ILoggerFactory>(new NullLoggerFactory());
services.AddMvc();
}
public void Configuration(IBuilder app) public void Configuration(IBuilder app)
{ {
CreateAdminUser(app.ServiceProvider); CreateAdminUser(app.ServiceProvider);
app.UseContainer(ConfigureServices);
//ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production. //ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.
app.UseErrorPage(ErrorPageOptions.ShowAll); app.UseErrorPage(ErrorPageOptions.ShowAll);
var serviceCollection = new ServiceCollection();
serviceCollection.AddInstance<ILoggerFactory>(new NullLoggerFactory());
serviceCollection.Add(MvcServices.GetDefaultServices());
app.UseContainer(serviceCollection.BuildServiceProvider(app.ServiceProvider));
app.UseFileServer(); app.UseFileServer();
app.UseCookieAuthentication(new CookieAuthenticationOptions() app.UseCookieAuthentication(new CookieAuthenticationOptions()
@ -50,7 +53,7 @@ public class Startup
var routes = new RouteCollection() var routes = new RouteCollection()
{ {
DefaultHandler = new MvcApplication(app.ServiceProvider), DefaultHandler = new MvcRouteHandler(),
}; };
routes.MapRoute( routes.MapRoute(