Пример #1
0
        public async Task <IActionResult> GetItems(string username)
        {
            var query  = new GetCatalogItems(username);
            var result = await mediator.Send(query);

            return(View(result));
        }
Пример #2
0
        public IActionResult About()
        {
            //get all catalog items, to know what to order
            GetCatalogItems jsonToBe = new GetCatalogItems
            {
                Action = Action.GetAll
            };

            _eventBus.Publish(jsonToBe, "Catalog");

            return(View());
        }
Пример #3
0
        public async Task <IEnumerable <CatalogItemDto> > Handle(GetCatalogItems request, CancellationToken cancellationToken)
        {
            var query = await repo.ReadAll();

            return(mapper.Map <IEnumerable <CatalogItemDto> >(query));
        }