public Job Update(UpdateJobCommand command)
        {
            var Job = _repository.GetOne(command.Id);

            if (command.RealizationDate != null)
            {
                Job.ChangeRealizationDate(command.RealizationDate);
            }
            if (command.StartDate != null)
            {
                Job.ChangeStartDate(command.StartDate);
            }
            if (command.VerificationDate != null)
            {
                Job.ChangeVerifaciontDate(command.VerificationDate);
            }

            _repository.Update(Job);

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

            return(null);
        }
예제 #2
0
 public ResultDto UpdateJob(long id, JobDto jobDto)
 {
     return(Result(() => {
         var command = new UpdateJobCommand
         {
             JobId = jobDto.Id,
             Description = jobDto.Description,
         };
         CommandDispatcher.Send(command);
     }));
 }
예제 #3
0
        public async Task <ActionResult> Update(UpdateJobCommand command)
        {
            await Mediator.Send(command);

            return(NoContent());
        }
예제 #4
0
        public async Task <ActionResult> Update([FromBody] UpdateJobCommand updateJobCommand)
        {
            await _mediator.Send(updateJobCommand);

            return(NoContent());
        }