Linq To Sql多表联合查询
var pro = (from ps in db.ProductInfoes join pt in db.ProductTypees on ps.productType equals pt.pType orderby ps.inDate descending select new {ps.ID,ps.productName,ps.inDate,pt.typeName }).ToList();
这句代码是指:
通过ProductInfoes.productType =productType .pType 这一条件查询表ProductInfoes和表productType
并且读取表ProductInfoes的ID,productName,inDate字段,以及表productType 的typeName字段