Linq to entities multiple WHERE clause &&
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
精彩评论