Ejemplo n.º 1
0
        public async Task <Result <List <MasterTradingAgreementDto> > > Handle(GetAllMasterTradingAgreementsQuery request, CancellationToken cancellationToken)
        {
            var items = await _db.QueryFor <MasterTradingAgreement>().Include(x => x.ContractSchedules)
                        .ProjectTo <MasterTradingAgreementDto>(_mapper.ConfigurationProvider)
                        .OrderBy(t => t.Name)
                        .ToListAsync(cancellationToken);

            return(Result.Ok(items));
        }
Ejemplo n.º 2
0
        public async Task <Result <List <ToDoItemDto> > > Handle(GetAllToDosQuery request, CancellationToken cancellationToken)
        {
            var items = await _db.QueryFor <ToDoItem>()
                        .ProjectTo <ToDoItemDto>(_mapper.ConfigurationProvider)
                        .OrderBy(t => t.Title)
                        .ToListAsync(cancellationToken);

            return(Result.Ok <List <ToDoItemDto> >(items));
        }