public async Task <Unit> Handle(FinalizarProjetoCommand command, CancellationToken cancellationToken) { var projeto = await _repository.ObterAsync(command.Id); projeto.Finalizar(); await _repository.SaveChangesAsync(); return(Unit.Value); }
public async Task <Unit> Handle(AtualizarProjetoCommand command, CancellationToken cancellationToken) { var projeto = await _repository.ObterAsync(command.Id); projeto.Atualizar(command.Titulo, command.Descricao, command.CustoTotal); await _repository.SaveChangesAsync(); return(Unit.Value); }