开发者

Linq to sql type comparison

I have a varialbe name age and that's type is int? My linq to sql query is:

from t in db.Profiles where t.age == age select t

having a comparison between int and int? at where clause. how the query p开发者_StackOverflowrocessor of linq to sql will process in this case?


If age is a type int? then I believe your query should read as follows:


from t in db.Profiles where t.age == age.Value select t

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜