3

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
  select quot;

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

4
  • Delegate 'System.Func<LocalGarageFinder.Quotes,int,bool>' does not take '1' arguments C:\LocalGarageFinder\LocalGarageFinder\EnquiryDetail.aspx.cs 56 33 LocalGarageFinder Commented Feb 22, 2010 at 15:29
  • Cannot convert lambda expression to type 'string' because it is not a delegate type C:\LocalGarageFinder\LocalGarageFinder\EnquiryDetail.aspx.cs 56 33 LocalGarageFinder Commented Feb 22, 2010 at 15:29
  • It is solved, just had to instanciate currentUserId Commented Feb 22, 2010 at 15:31
  • you could post the correct syntax for others with the same problem. Tks Commented Jan 14, 2011 at 19:11

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

3

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.