public bool DeleteUserById(User userId) { _repositoryFactory.RunInTransaction(() => { _userRepository.DeleteEntity(userId); }); return true; }
public bool AddUser(User user) { _repositoryFactory.RunInTransaction(() => { _userRepository.AddEntity(user); }); return true; }
private User CollectUser() { var user = new User { UserId = Guid.NewGuid(), Name = Environment.UserName, DomainName = Environment.UserDomainName, LogTime = DateTime.Now }; using (var userServiceClient = new UserServiceClient()) { userServiceClient.AddUser(user); user = userServiceClient.GetUserById(user.UserId); } return user; }