Afs*_*bbi 2 nhibernate linq-to-nhibernate
假设我有课程Animal,Cat并且Dog.Cat并Dog继承自Animal.考虑以下代码:
var query = from animal in session.Linq<Animal>()
where
animal.Color == "White"
select animal;
Run Code Online (Sandbox Code Playgroud)
如何向上述查询添加条件以查询实体类型?比如像animal.Type == typeof(Cat).
Die*_*hon 11
新提供商支持此功能:
var query = from animal in session.Query<Animal>()
where animal.Color == "White" &&
animal is Cat
select animal;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2259 次 |
| 最近记录: |