public bool Register(AuthenticationRequest request) { var entity = request.ToUserExtension(Enums.UserTypeEnum.NormalUser); _userRepostiory.Create(entity); return(_userRepostiory.SaveChanges()); }
public bool Register(AuthenticationRequest request) { var entity = request.ToUserExtension(Enums.UserTypeEnum.Client); _userRepository.Create(entity); return(_userRepository.SaveCh()); }
public bool Register(AuthenticationRequest request, String nume, String parola, String email) { var entity = request.ToUserExtension(nume, parola, email); _userRepostiory.Create((User)entity); return(_userRepostiory.SaveChanges()); }
public AuthenticationResponse Register(AuthenticationRequest request) { var entity = request.ToUserExtension(Enums.UserTypeEnum.Client); _repository.Add(entity); var token = GenerateJwtForUser(entity); _repository.SaveChanges(); return(new AuthenticationResponse { Id = entity.Id, Email = entity.Email, Type = entity.Type, Token = token }); }