예제 #1
0
        public PageResult <ItemMaster> GetPageItemsList(PageAndSortedQuery <ItemDetailsQuery> query)

        {
            var connectionString = Startup.connectionstring;

            var con          = new ShoppingContext(connectionString);
            var searchResult = con.itemMasterEntity.Select(x => new ItemMaster
            {
                ItemName        = x.ItemName.Trim(),
                Active          = x.Active,
                AvailableColor  = x.AvailableColor.Trim(),
                AvailableQty    = x.AvailableQty,
                brand           = x.brand.Trim(),
                CategoryId      = x.CategoryId,
                Color           = x.Color.Trim(),
                detailId        = x.detailId,
                image           = x.image.Trim(),
                InitialQty      = x.InitialQty,
                DeliveryCharges = x.deliveryCharges,
                itemDescription = x.ItemDescripton.Trim(),
                OfferPrice      = x.OfferPrice,
                Price           = x.Price,
                ReserveQty      = x.ReserveQty,
                SizeId          = x.SizeId,
                itemid          = x.ItemId
            })
                               .ApplySorting(query)
                               .Paging(query);

            return(searchResult);
        }
예제 #2
0
        public IActionResult AllItemsOnPaging(PageAndSortedQuery <ItemDetailsQuery> query)

        {
            PageResult <ItemMaster> data = null;

            try
            {
                //data = _operations.GetPageItemsList(query);
                return(Ok(_operations.GetPageItemsList(query)));
            }

            catch (Exception e)
            {
                return(BadRequest());
            }
        }