日期:2014-05-20 浏览次数:20994 次
var pt = from d in product_DatadoDataContext.view_CategoryProgramProductTable where d.CategoryProgramId == CategoryProgramId select new ProductTableModel() { Sku = d.Sku, ImageUrl = d.ImageUrl, Url = d.Url, ProductName = d.ProductName, ProductDescription = d.ProductDescription, ProductKeywords = Convert.ToString(d.ProductKeywords), UserId = d.UserId, BrandId = d.BrandId, BrandsModel = (from b in product_DatadoDataContext.Brands where b.BrandId == d.BrandId select new BrandsModel() { BrandName = b.BrandName, Status = b.Status, }).FirstOrDefault(), CreateDate = d.CreateDate, UpdateDate = d.UpdateDate, Status = d.Status, Csku = d.Csku, OptionsValuesList = (from pvl in product_DatadoDataContext.view_OptionsValuesProduct where pvl.Sku.Equals(d.Sku) select new OptionsValuesModel() { OId = pvl.OId, OvId = pvl.OvId, OptionsValue = pvl.OptionsValue, Sort = Convert.ToInt32(pvl.Sort) }).ToList(), ProductCurrencyRelationList = (from pcr in product_DatadoDataContext.ProductCurrencyRelation where pcr.Sku.Equals(d.Sku) select new ProductCurrencyRelationModel() { CurrencyId = pcr.CurrencyId, Sku = pcr.Sku, Price = pcr.Price, SpecialsPrice = pcr.SpecialsPrice }).ToList() }; list = pt.ToList();