So basically after finally learning how to change OpenAuth to not use DefaultConnection in .NET 4.5, I\'ve moved on to 4.5.1, rendering those learnings moot. The duties of AuthC
Works with Microsoft.AspNet.Identity.EntityFramework 1.0.0-rc1
In the parameterless constructor for AccountController, change the line
IdentityManager = new AuthenticationIdentityManager(new IdentityStore());
to
IdentityManager = new AuthenticationIdentityManager(new IdentityStore(new DefaultIdentityDbContext("YourNameOrConnectionString")));
and you're good to go.
Works with Microsoft.AspNet.Identity.EntityFramework 1.0.0
Similar to what we did for release candidate, but we do this in a different place. Open IdentityModels.cs
that was created as part of the VS template and add the following constructor to the ApplicationDbContext
class:
public ApplicationDbContext(string nameOrConnectionString)
: base(nameOrConnectionString)
{
}
and you can now change the parameterless constructor in AccountController
from
public AccountController()
: this(new UserManager(new UserStore(new ApplicationDbContext())))
{
}
to
public AccountController()
: this(new UserManager(new UserStore(new ApplicationDbContext("YourNameOrConnectionString"))))
{
}
and your done.