Exemplo n.º 1
0
        public bool Register(AuthenticationRequest request)
        {
            var entity = request.ToUserExtension(Enums.UserTypeEnum.NormalUser);

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

            _userRepository.Create(entity);
            return(_userRepository.SaveCh());
        }
Exemplo n.º 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());
        }
Exemplo n.º 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
            });
        }