Inflearn Community Q&A
로그인실패
Written on
·
211
0
var user = new ApplicationUser { UserName = model.Email, Email = model.Email };
var result = await _userManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
return RedirectToAction("Login");
}
result 값을보면 null로 자꾸반환되는데 원인을 모르겠어요... 어디서부터확인을해야할까요?
Answer 1
0
startup.cs ConfigureServices함수
services.AddDbContext<MyAppContext>(options =>
{
options.UseSqlServer(_config.GetConnectionString("MyAppConnection"));
});
services.AddIdentity<ApplicationUser, IdentityRole>(options =>
{
options.Password.RequiredLength = 6;
})
.AddEntityFrameworkStores<MyAppContext>();
확인하시고
유저 테이블들 생성된것도 확인하시기 바랍니다.
MyAppContext.cs도 체크
MyAppContext : IdentityDbContext<ApplicationUser>





