public UserDto Create(UserDto userDto) { UserDto createdUserDto; using (ITransaction transaction = Session.BeginTransaction()) { User user = UserManager.CreateUser(userDto.GooglePlusId ?? string.Empty); createdUserDto = UserDto.Create(user); transaction.Commit(); } return createdUserDto; }
public void PatchUser_GooglePlusIdProvided_GooglePlusIdModified() { User user = Helpers.CreateUser(); string newGooglePlusId = Helpers.GetRandomGooglePlusId(); UserDto userDto = new UserDto {GooglePlusId = newGooglePlusId}; UserController.Patch(user.Id, userDto); Assert.AreEqual(user.GooglePlusId, newGooglePlusId); }
public void UpdateGooglePlusId(UserDto userDto) { using (ITransaction transaction = Session.BeginTransaction()) { UserManager.UpdateGooglePlusId(userDto.Id, userDto.GooglePlusId); transaction.Commit(); } }
public void Patch(Guid id, UserDto userDto) { using (ITransaction transaction = Session.BeginTransaction()) { User user = UserManager.Get(id); userDto.SetPatchableProperties(user); UserManager.Update(user); transaction.Commit(); } }