Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6999615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:33:54+00:00 2026-05-27T20:33:54+00:00

The error message I am getting is: The type arguments for method ‘System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource)’

  • 0

The error message I am getting is:

The type arguments for method ‘System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource)’ cannot be inferred from the usage. Try specifying the type arguments explicitly.

When I run the following code I get an error message saying that I need to explicitly specify the type of argument for method contains.

var result2 = from cltIntake in db.Client_Intakes
              where (from cltElig in db.Client_Eligibility_Referrals
                     where (
                            from cltDoctVerif in db.Doct_Verifications
                            where cltDoctVerif.Verification_Status == "Yes"
                            select cltElig.Asgnd_Caseworker_ID == 6
                            ).Contains(cltElig.Client_Eligibility_ID)
                     select new { client_Eligibility_ID = cltElig.Client_Eligibility_ID }
                    ).Contains(cltIntake.Client_Intake_ID)
                select new
                  {
                      cltInfo.First_Name,
                      cltInfo.Last_Name,

                  };

I have looked around a lot and tried to cast to type int, since the collection is type int, as follows

.Contains<Int32>(cltElig.Client_Eligibility_ID)

but that threw an error saying:

Instance argument: cannot convert from ‘System.Linq.IQueryable’ to ‘System.Linq.IQueryable’
Instance argument: cannot convert from ‘System.Linq.IQueryable’ to ‘System.Linq.IQueryable’

I really appreciate if someone gives me a solution for this. The thing is I don’t really know much about IQueryable.
Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:33:54+00:00Added an answer on May 27, 2026 at 8:33 pm

    The problem is that your selection is creating a sequence of anonymous types, but your call to Contains is passed a Int

    So rather than select new { client_Eligibility_ID = cltElig.Client_Eligibility_ID } just do select cltElig.Client_Eligibility_ID additionally you have select cltElig.Asgnd_Caseworker_ID == 6' which is projecting a boolean. You probably wanted&& cltElig.Asgnd_Caseworker_ID == 6`

    Additionally, consider simplifying the query

    var result2 = from cltIntake in db.Client_Intakes
                  from cltElig in db.Client_Eligibility_Referrals
                  from cltDoctVerif in db.Doct_Verifications
                  where cltDoctVerif.Verification_Status == "Yes"
                       && cltElig.Asgnd_Caseworker_ID == 6
                       && cltDoctVerif.Client_Eligibility_ID == 
                              cltElig.Client_Eligibility_ID
                       && cltElig.Client_Eligibility_ID == 
                              cltIntake.Client_Intake_ID
                select new
                  {
                      cltInfo.First_Name,
                      cltInfo.Last_Name,
                  };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the following error: The type arguments for method 'System.Web.Mvc.Html.DisplayExtensions.DisplayFor<TModel,TValue>(System.Web.Mvc.HtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel,TValue>>, string)' cannot
I'm currently getting a Could not load type UI.Administration.Site.master error message and I'm not
I am getting an error message like so: Linear.hs:215:27: Couldn't match expected type `forall
I'm getting an error message when I try to build my project in eclipse:
I'm getting this error message on all projects (including brand new empty templates) I'm
I'm getting an error message from a python script at position 21490 . How
I'm getting this error message whiile running a Webservice I'm working on. it builds,
I'm getting the error message when running the following code from a C# console
I'm getting this error message with the code below: class Money { public: Money(float
I am getting an error message expression must have constant value when initializing an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.