public Task <HttpResponseMessage> Post([FromBody] dynamic body) { var command = new CreateProfileUserCommand( profile: (string)body.profile ); var profile = _service.Create(command); return(CreateResponse(HttpStatusCode.Created, profile)); }
public ProfileUser Create(CreateProfileUserCommand command) { var profile = new ProfileUser(command.Profile); profile.Register(); _repository.Create(profile); if (Commit()) { return(profile); } return(null); }