这可能吗?
var results = (from c in _context.properties
where c.strap == somevalue
select c).include("characteristics).where(characteristics.cat_cd != 'DD');
基本上我想创建这个查询。随着应用程序的增长,我将包括其他表格。
select * from properties p,characteristics c
where
p.strap = c.strap
and c.cat_cd <> 'DD'
答案 0 :(得分:0)
您只需制作join
声明:
var set = from property in _context.Properties
join characteristic in _context.Characteristcs on property.strap equals characteristic.strap
select new
{
Property = property,
Characteristic = characteristic
}
答案 1 :(得分:0)
这是我学到的东西。
var results = (from c in _context.properties
where c.Characteristics.Any(c=>c.cat_cd == "DD") select c);