After some digging...it seems that CreatePerOwinContext
was primarily part of a dependency injection mechanism.
Microsoft.AspNetCore 1.0.0 supports dependency injection as a first-class citizen.
https://docs.asp.net/en/latest/fundamentals/dependency-injection.html
Extensions are available for most of the common Identity services that are required. For example, below is a comparison of the CreatePerOwinContext
compared to the IServiceCollection
IServiceCollection (AspNetCore 1.0.0)
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(config.GetConnectionString("DefaultConnection")));
}
}
CreatePerOwinContext (obsolete)
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.CreatePerOwinContext(ApplicationDbContext.Create);
}
}