Example #1
0
        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);
        }
Example #3
0
        public void UpdateGooglePlusId(UserDto userDto)
        {
            using (ITransaction transaction = Session.BeginTransaction())
            {
                UserManager.UpdateGooglePlusId(userDto.Id, userDto.GooglePlusId);

                transaction.Commit();
            }
        }
Example #4
0
        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();
            }
        }