예제 #1
0
        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);
        }
예제 #2
0
        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);
        }