public IActionResult Register(ModelsDAL.UserALL user) { string PrivateKey = _keyGenerator.PrivateKey; user.Password = decrypting.Decrypt(user.Password, PrivateKey); _userRepository.Create(user); return(Ok()); }
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 }); }
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()); } }
public IActionResult Post(ModelsDAL.UserALL user) { _userRepository.Create(user); return(Ok()); }