강의

멘토링

커뮤니티

Inflearn Community Q&A

alswhd204541's profile image
alswhd204541

asked

Overseas Employment ASP.NET Core Web Development Basic Course

Account Creation Logic

로그인실패

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로 자꾸반환되는데 원인을 모르겠어요... 어디서부터확인을해야할까요?

ASP.NET-Core

Answer 1

0

SEJONG IT EDU님의 프로필 이미지
SEJONG IT EDU
Instructor

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>

 

alswhd204541's profile image
alswhd204541

asked

Ask a question