public Task<HttpResponseMessage> Put([FromBody]dynamic body)
        {
            var listCoach = _serviceCoach.AddCoach(body.coach);
            var listCoachee = _serviceCoachee.AddCoachee(body.coachee);
            var listPerformanceIndicator = _servicePerformanceIndicator.AddToCoachingProcess(body.performanceIndicator);
            var listService = _service.AddToCoachingProcess(body.service);

            if (body.endDate == null || body.endDate == "")
                body.endDate = DateTime.MinValue;

            var coachingProcess = _serviceCoachingProcess.GetOneIncludeDetails(Guid.Parse((string)body.id));

            coachingProcess = _serviceCoach.CheckCoachRemovedOfCoachingProcess(listCoach, coachingProcess);
            coachingProcess = _serviceCoachee.CheckCoacheeRemovedOfCoachingProcess(listCoachee, coachingProcess);
            coachingProcess = _service.CheckServiceRemoved(listService, coachingProcess);

            var commandCoachingProcess = new UpdateCoachingProcessCommand(
                id: Guid.Parse((string)body.id),
                name: (string)body.name,
                startDate: (DateTime)body.startDate,
                endDate: (DateTime)body.endDate,
                mode: (EModeProcess)body.mode,
                coach: coachingProcess.Coach,
                coachee: coachingProcess.Coachee,
                performanceIndicator: listPerformanceIndicator,
                service: coachingProcess.Service,
                observation: (string)body.observation
              );

            _servicePerformanceIndicator.CheckPerformanceIndicatorRemoved(listPerformanceIndicator, coachingProcess.Id);
            coachingProcess = _serviceCoachingProcess.Update(commandCoachingProcess);

            return CreateResponse(HttpStatusCode.Created, coachingProcess);
        }
        public CoachingProcess Update(UpdateCoachingProcessCommand command)
        {
            var coachingProcess = _repository.GetOneIncludeDetails(command.Id);

            if (!string.IsNullOrEmpty(command.Name))
                coachingProcess.ChangeName(command.Name);
            if (command.StartDate != DateTime.MinValue)
                coachingProcess.ChangeStartDate(command.StartDate);
            if (command.Mode != 0)
                coachingProcess.ChangeMode(command.Mode);
            if (command.EndDate != DateTime.MinValue)
                coachingProcess.ChangeEndDate(command.EndDate);
            if (!string.IsNullOrEmpty(command.Observation))
                coachingProcess.ChangeObservation(command.Observation);
            if (command.PerformaceIndicator != null)
            {
                foreach (var performanceIndicator in command.PerformaceIndicator)
                {
                    coachingProcess.AddPerformanceIndicator(performanceIndicator);
                }
            }
            if (command.Service != null)
            {
                foreach (var service in command.Service)
                {
                    coachingProcess.AddService(service);
                }
            }

            if (command.Budget != null)
            {
                foreach (var budget in command.Budget)
                {
                    coachingProcess.AddBudget(budget);
                }
            }
            if (command.Coach != null)
            {
                foreach (var coach in command.Coach)
                {
                    coachingProcess.AddCoach(coach);
                }
            }
            if (command.Session != null)
            {
                foreach (var coachee in command.Coachee)
                {
                    coachingProcess.AddCoachee(coachee);
                }
            }
            if (command.Session != null)
            {
                foreach (var session in command.Session)
                {
                    coachingProcess.AddSession(session);
                }
            }

            _repository.Update(coachingProcess);

            if (Commit())
                return coachingProcess;

            return null;
        }