开发者

Linq to entities multiple WHERE clause &&

开发者 https://www.devze.com 2022-12-21 01:53 出处:网络
In the code bdehind && syntax does not work, any ideas? Entities ctx3 = new Entities(); var uniqueQuote = from quot in ctx3.Quotes.Include(\"aspnet_Users\").Include(\"Enquiries\")

In the code bdehind && syntax does not work, any ideas?

Entities ctx3 = new Entities();
var uniqueQuote = from quot in ctx3.Quotes.Include("aspnet_Users").Include("Enquiries")
  where quot.Enquiries.EnquiryId == selectedEnquiryId &&
     quot.aspnet_Users.UserId == currentUserId
  orderby quot.QuotePrice
开发者_JAVA技巧  select quot;

Error 2 Delegate 'System.Func' does not take '1' arguments C:\LocalGarageFinder\LocalGarageFinder\EnquiryDetail.aspx.cs 56 33 LocalGarageFinder


The code as written is fine. If you are receiving some sort of error, please let us know.


If EnquiryId or UserId is a Nullable type you will get the error. Use EnquiryId.Value == selectedEnquiryId or UserId.Value == currentUserId

0

精彩评论

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