"and"语法在实体框架中进行不同的操作

本文关键字:quot 操作 框架 and 语法 实体 | 更新日期: 2023-09-27 18:16:06

我想显示accountid, id匹配的记录,并显示不同的记录。

var result = from a in cxt.tblInventoryProducts
             where a.aid == accID && a.id == id
             select new
             {
                 a.productType,
                 a.productName
             };

Thanks in advance

"and"语法在实体框架中进行不同的操作

类似

var result = from a in cxt.tblInventoryProducts
             where a.aid == accID && a.id == id
             group a by new { a.productType, a.productName } into grp
             select new
             {
                 grp.Key.productType,
                 grp.Key.productName
             };
相关文章: