public IDataResult <SystemUser> Register(SystemUserForRegisterDto systemUserForRegisterDto, string password) { byte[] passwordHash, passwordSalt; HashingHelper.CreatePasswordHash(password, out passwordHash, out passwordSalt); var systemUser = new SystemUser { Email = systemUserForRegisterDto.Email, FirstName = systemUserForRegisterDto.FirstName, LastName = systemUserForRegisterDto.LastName, PasswordHash = passwordHash, PasswordSalt = passwordSalt, Status = true }; _systemUserService.Add(systemUser); return(new SuccessDataResult <SystemUser>(systemUser, Messages.UserRegistered)); }
public IActionResult AddUserTest() { try { SystemUser systemUser = new SystemUser { Id = Guid.NewGuid().ToString(), AddTime = DateTime.Now, IsLock = false, IsDelete = false, UserName = "******", Password = "******" }; _systemUserService.Add(systemUser); _unitOfWork.Commit(); return(Ok(Newtonsoft.Json.JsonConvert.SerializeObject(systemUser))); } catch (Exception ex) { throw ex; } }