VNext'i anlamaya çalışıyorum. Startup.cs yılında
vSonraki. AspNet.Identity ve özel UserStore. UserStore istisnai istisna
public class UserStore : IUserStore<ApplicationUser>, IUserPasswordStore<ApplicationUser>, IUserSecurityStampStore<ApplicationUser>,
IUserLoginStore<ApplicationUser>, IUserClaimStore<ApplicationUser>, IUserEmailStore<ApplicationUser>, IUserRoleStore<ApplicationUser>,
IUserTwoFactorStore<ApplicationUser>
eklendi:
app.UseServices(services =>
{
services.AddIdentity<ApplicationUser>()
.AddUserStore(() => { return new UserStore(); })
.AddUserManager<UserManager<ApplicationUser>>()
.AddHttpSignIn();
services.AddMvc();
});
Sonra Visual Studio şablondan değişmeden AccountController kullanmak ve sorunları var çalıştı
Ben MongoDB ile çalışır ve bu arabirimleri uygulayan özel UserStore yazdı .
i UserStore.FindByNameAsync içinde ObjectDisposedException almakla imzalama() - UserStore.Dispose denilen şey().
UserManager kodunda github.com/aspnet Store.Dispose() 'da yalnızca UserManager.Dispose() içinde çağrılır.
Sadece Dispose çağrılarını görmezden gelebilirim ve her şey iyi, ama bu iyi bir yol değil.
Yani ben
dip not yapacağız ne olursa fikirleri var Soru şudur: Ne (ve neden) UserStore.Dispose()? vNext yılında
UserManager AccountController (UserManager, SignInManager) parametreleri. –