예제 #1
0
        public bool Register(AuthenticationRequest request)
        {
            var entity = request.ToUserExtension(Enums.UserTypeEnum.NormalUser);

            _userRepostiory.Create(entity);
            return(_userRepostiory.SaveChanges());
        }
예제 #2
0
        public bool Register(AuthenticationRequest request)
        {
            var entity = request.ToUserExtension(Enums.UserTypeEnum.Client);

            _userRepository.Create(entity);
            return(_userRepository.SaveCh());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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
            });
        }