public IHttpActionResult Get() { var user = _repository.Get(_currentUser.Id); var userNames = new UserNamesModel(user.FirstName, user.Surname); return(Ok(userNames)); }
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()); }
public void GivenTheCurrentUserNeedsToChangeTheirName() { var usernames = new UserNamesModel("first", "last"); ScenarioCache.Store(ModelKeys.UserNames, usernames); }