C
C#2y ago
Alparslan~

I need help for register

I can get username and password but "userCreate" return null. what is wrong ?
7 Replies
Instinct
Instinct2y ago
Is it null because you've put the return before setting it?
Alparslan~
Alparslan~2y ago
which return ? i wrote like in the video.
Instinct
Instinct2y ago
return Ok();
Alparslan~
Alparslan~2y ago
I put it at the end and register was added to the data. should I remove the status code? Thanks for help
dancepanda42
dancepanda422y ago
I think the return Ok(); should be in the line 36. To return the statuscode 200 if the user already exists.
if (await authRepository.UserExists(userForRegisterDto.UserName))
{
....otherCode
return Ok();
}
if (await authRepository.UserExists(userForRegisterDto.UserName))
{
....otherCode
return Ok();
}
Alparslan~
Alparslan~2y ago
I did it this way and i remove status code. now i can add user
dancepanda42
dancepanda422y ago
this is also ok 👍
Want results from more Discord servers?
Add your server
More Posts