c# mvc login service
0
$begingroup$
I want to make a service which will authorize users. I want to separate it from controller. The problem is, I can't figure out what should my methods return. Here is my method: public async Task<BaseResponse> Login(string email, string pwd) { BaseResponse response = new BaseResponse(); var user = userManager.Users.Where(u => u.Email == email).FirstOrDefault(); if (user == null) { response.Errors.Add(Errors.WrongEmail); } else { var result = await signInManager.PasswordSignInAsync(user, pwd, false, false); if (result.Succeeded) { response.Success = true; } else { response.Errors.Add(Error...