コード例 #1
0
        private EngineDetails GetEngineDetails(Guid engineId)
        {
            var query  = new GetSingleEngine(engineId);
            var result = queryBus.InvokeQuery <EngineDetails>(query);

            return(result.Data);
        }
コード例 #2
0
        public IActionResult GetVehicles([FromQuery] int pageSize = 10,
                                         [FromQuery] int pageNo   = 1,
                                         [FromQuery] VehicleOrderColumn orderbyColumn = VehicleOrderColumn.Manufacturer,
                                         [FromQuery] OrderDirection orderDirection    = OrderDirection.Asc)
        {
            var query  = new GetVehicleDetailsList(pageSize, pageNo, orderbyColumn, orderDirection);
            var result = queryBus.InvokeQuery <PaginatedList <VehicleDetails> >(query);

            return(Ok(result.Data));
        }
コード例 #3
0
        private IQueryResult <UserDetails> GetUserDetails(Guid?userId = null)
        {
            IQueryResult <UserDetails> result;

            if (userId.HasValue)
            {
                result = queryBus.InvokeQuery <UserDetails>(new GetSingleUser(userId.Value));
            }
            else
            {
                result = queryBus.InvokeQuery <UserDetails>(new GetSingleUser(HttpContext.GetCurrentUserId()));
            }

            return(result);
        }
コード例 #4
0
        public IActionResult GetManufacturers([FromQuery] int pageSize = 10,
                                              [FromQuery] int pageNo   = 1,
                                              [FromQuery] OrderDirection orderDirection = OrderDirection.Asc)
        {
            var query  = new GetManufacturersList(pageSize, pageNo, orderDirection);
            var result = queryBus.InvokeQuery <PaginatedList <ManufacturerDetails> >(query);

            return(Ok(result.Data));
        }