【发布时间】:2013-06-21 13:50:20
【问题描述】:
我正在使用实体框架进行以下 Linq 查询。
var res = from a in _db.Articles
from auth in a.Authors
where papers.Contains(a.JoomlaId)
select auth.Institution;
问题是我的机构类有一个名为“Type”的变量,类型为“InstitutionType”,我需要包含该变量,但我不知道该怎么做。
【问题讨论】:
-
不要把你的变量称为“类型”,你未来的自己会杀了你
-
你说得有道理,我不否认,但如果我称它为机构类型,它会像
Institution.InstitutionType一样也不好。 -
关联类型?我会尝试程序员交流,但是机构类型对我来说听起来不错,听起来不像是静态类型
标签: c# mysql asp.net-mvc entity-framework