Example #1
0
        public IHttpActionResult Get()
        {
            var user      = _repository.Get(_currentUser.Id);
            var userNames = new UserNamesModel(user.FirstName, user.Surname);

            return(Ok(userNames));
        }
Example #2
0
        public IHttpActionResult Put([FromBody] UserNamesModel model)
        {
            var user = new User(_currentUser.Id)
            {
                FirstName = model.FirstName,
                Surname   = model.Surname
            };

            var updateUser = new UpdateUserNames(user);
            var result     = _actionHandlerOverlord.HandleAction <UpdateUserNames, User>(updateUser);

            return(new ActionResultToOkHttpActionResult <User, UserModel>(result, x => x.ToModel(), this)
                   .Do());
        }
Example #3
0
        public void GivenTheCurrentUserNeedsToChangeTheirName()
        {
            var usernames = new UserNamesModel("first", "last");

            ScenarioCache.Store(ModelKeys.UserNames, usernames);
        }