0

Is this possible?

var results = (from c in _context.properties
               where c.strap == somevalue
               select c).include("characteristics).where(characteristics.cat_cd != 'DD');

essentially I want to create this query. I will be include(ing) other tables as the app grows.

select * from properties p,characteristics c
where 
p.strap = c.strap
and c.cat_cd <> 'DD'
4

2 回答 2

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
          }
于 2012-05-21T18:47:06.210 回答
0

这是我学到的。

var results = (from c in _context.properties
               where c.Characteristics.Any(c=>c.cat_cd == "DD") select c);
于 2013-05-08T14:01:14.930 回答