public async Task <Guid> Handle(AddObjectiveCommand request, CancellationToken cancellationToken) { var objective = _objectiveFactory.Create(request.Name, request.Description); await _objectiveRepository.Create(objective); await _unitOfWork.Commit(); return(objective.Id); }
public Objective Create(CreateObjectiveCommand command) { var service = new Objective(command.Description, command.Term, command.Mark); service.Validate(); _repository.Create(service); if (Commit()) { return(service); } return(null); }