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

                transaction.Commit();
            }
        }
Exemplo n.º 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();
            }
        }