Exemplo n.º 1
0
        public IActionResult Register(ModelsDAL.UserALL user)
        {
            string PrivateKey = _keyGenerator.PrivateKey;

            user.Password = decrypting.Decrypt(user.Password, PrivateKey);

            _userRepository.Create(user);
            return(Ok());
        }
Exemplo n.º 2
0
 public static ModelsAPI.User DALToAPI(this ModelsDAL.UserALL DALToAPI)
 {
     return(new ModelsAPI.User
     {
         UserID = DALToAPI.UserID,
         LastName = DALToAPI.LastName,
         FirstName = DALToAPI.FirstName,
         Email = DALToAPI.Email,
         TypeUser = DALToAPI.TypeUser
     });
 }
Exemplo n.º 3
0
        public IActionResult Login(ModelsDAL.UserALL user)
        {
            string PrivateKey = _keyGenerator.PrivateKey;

            user.Password = decrypting.Decrypt(user.Password, PrivateKey);


            ModelsAPI.User OneUser = _userRepository.Login(user).DALToAPI();
            if (OneUser != null)
            {
                return(Ok(OneUser));
            }
            else
            {
                return(NotFound());
            }
        }
Exemplo n.º 4
0
 public IActionResult Post(ModelsDAL.UserALL user)
 {
     _userRepository.Create(user);
     return(Ok());
 }