Exemple #1
0
        public Task <HttpResponseMessage> Put(int id, [FromBody] dynamic body)
        {
            var command = new UpdateProfileUserCompanyCommand(
                idProfileUser: id,
                profile: (string)body.profile
                );

            var profile = _service.Update(command);

            return(CreateResponse(HttpStatusCode.Created, profile));
        }
        public ProfileUser Update(UpdateProfileUserCompanyCommand command)
        {
            var profile = _repository.GetById(command.ProfileId);

            profile.UpdateProfile(command.Profile);
            _repository.Update(profile);

            if (Commit())
            {
                return(profile);
            }

            return(null);
        }