Linq for entities several WHERE && clauses

The syntax does not work in bdehind && code, 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
  select quot;

Error 2 The delegate "System.Func" does not accept the arguments "1" C: \ LocalGarageFinder \ LocalGarageFinder \ InquiryDetail.aspx.cs 56 33 LocalGarageFinder

+3
source share
2 answers

Well written code. If you get any kind of error, let us know.

+3
source

If the InquiryId or UserId is Nullable, you will receive an error message. Use InquiryId.Value == selectedEnquiryId or UserId.Value == currentUserId

+3
source

Source: https://habr.com/ru/post/1733906/


All Articles