//GetPastListForEvent public IEnumerable <AuctionShort> GetPastListForEvent(CategoryFilterParams filter) { int?totalrecords = 0; var pageindex = (filter.page > 0) ? filter.page - 1 : 0; var ash = (from p in dataContext.spAuction_View_List((long)filter.Id, -1, 2, (int)filter.Sortby - 1, (byte)filter.Orderby == 2, pageindex, filter.PageSize, ref totalrecords) select new AuctionShort { Bids = p.Bids.Value, CurrentBid = p.CurrentBid.Value, Estimate = p.Estimate, IsBold = p.IsBold.Value, IsFeatured = p.IsFeatured.Value, IsUnsoldOrPulledOut = p.IsUnsold.Value || p.IsPulledOut.Value, LinkParams = new LinkParams { ID = p.Auction_ID.Value, EventTitle = p.EventTitle, MainCategoryTitle = p.MainCategoryTitle, CategoryTitle = p.CategoryTitle }, Lot = p.Lot.HasValue ? p.Lot.Value : (short)0, Price = p.Price.Value, PriceRealized = p.PriceRealized.Value, PulledOut = p.IsPulledOut.Value, Status = p.AuctionStatus.Value, ThumbnailPath = p.ThumbnailPath, Title = p.Title, UnsoldOrPulledOut = p.IsUnsold.Value ? "UNSOLD" : "WITHDRAWN" }); return(new PagedList <AuctionShort>(ash.ToList(), pageindex, filter.PageSize, totalrecords.HasValue ? totalrecords.Value : 0)); }