日期:2014-05-20 浏览次数:21069 次
var result = (from p in query
join g in db.Inventory on new { SkuId = Convert.ToInt32(p.EbayOnlineProduct.SkuID), Wid = Convert.ToInt32(p.EbayOnlineProduct.WHID) }
equals new { SkuId = g.SKUId, Wid = g.WarehouseId } into pg
from inv in pg.DefaultIfEmpty()
select new
{
Id = p.Id,
Img = p.EbayOnlineProduct.EbayImgPath,
OurData = new
{
Title = p.EbayOnlineProduct.OnlineProductTitle,
Sku = p.EbayOnlineProduct.SKU
},
PurchasePrice = inv.NewPurchasePrice,
CptrImg = p.Product_Competitor.CPTR_SKUImg,
CptrData = new
{
Title = p.Product_Competitor.CPTR_Title,
eBayId = p.Product_Competitor.eBayID,
ItemId = p.CptrItemId
},
CptrOldPrice = p.CptrOldPrice,
CptrNewPrice = p.CptrNewPrice,
CptrDiffPrice = p.CptrDiffPrice,
Oname = inv.SKU.Sys_operators.oname,
Supplier = inv.SKU.supplier.sname,
ModifyDate = p.ModifyDate
}).Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
if (
Array.IndexOf(pi.PropertyType.GetInterfaces(), typeof(IEnumerable)) > -1 &&
pi.PropertyType.IsGenericType &&
!pi.PropertyType.GetGenericTypeDefinition().Equals(typeof(Nullable<>))
)