private EngineDetails GetEngineDetails(Guid engineId) { var query = new GetSingleEngine(engineId); var result = queryBus.InvokeQuery <EngineDetails>(query); return(result.Data); }
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)); }
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); }
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)); }