public CommandResult Create( [FromBody] CreateMatriculaCommand command, [FromServices] MatriculaHandler handler, [FromServices] IPagamentoRepository pagrepository ) { if (pagrepository.GetAll(command.IdAluno).Count() == 0) { return new CommandResult() { Data = command, Message = "Não há pagamentos para o aluno", Sucess = false } } ; return((CommandResult)handler.Handle(command)); }
public MatriculaController(IBusClient busClient, MatriculaHandler matriculaHandler) { _busClient = busClient; _matriculaHandler = matriculaHandler; }