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
精彩评论