public Task <HttpResponseMessage> Post([FromBody] dynamic body) { var listObjective = _serviceObjective.AddToActionPlan(body.objective); var coachingProcess = _serviceCoachingProcess.GetOne(Guid.Parse((string)body.idCoachingProcess)); var commandActionPlan = new CreateActionPlanCommand( listObjective, coachingProcess, (string)body.description ); var actionPlan = _serviceActionPlan.Create(commandActionPlan); return(CreateResponse(HttpStatusCode.Created, actionPlan)); }
public ActionPlan Create(CreateActionPlanCommand command) { var actionPlan = new ActionPlan(command.Objective, command.CoachingProcess, command.Description); actionPlan.Validate(); _repository.Create(actionPlan); if (Commit()) { return(actionPlan); } return(null); }