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 4039206
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:34:37+00:00 2026-05-20T12:34:37+00:00

I use asp.net, c# and EF4. I’m puzzled by this LINQ query: var queryContents

  • 0

I use asp.net, c# and EF4.

I’m puzzled by this LINQ query:

  var queryContents = from a in context.CmsContentsAssignedToes
                    where a.UserId == myUserGuid
                    join cnt in context.CmsContents
                    on a.ContentId equals cnt.ContentId
                    where cnt.TypeContent == myTypeContent & cnt.ModeContent == myModeContent
                    select cnt;

I would like write its equivalent in LINQ method syntax to retrieve CmsContents.

In my conceptual model are two entity types:

  • CmsContent
  • CmsContentsAssignedTo

and their entity sets:

  • CmsContents
  • CmsContentsAssignedToes

and navigation properties:

  • in CmsContent –> CmsContentsAssignedTo RETURN: –> Instance of CmsContentsAssignedTo
  • in CmsContentsAssignedTo –> CmsContent RETURN: –> Instance of CmsContent

Do you know how to do it? I tried for more that one day but I cannot solve it!

Thanks for your time!

  • 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-20T12:34:37+00:00Added an answer on May 20, 2026 at 12:34 pm

    The equivalent method syntax is:

     var queryContents = context.CmsContentsAssignedToes
                                .Where(a => a.UserId == myUserGuid)
                                .Join(context.CmsContents,
                                      a => a.ContentId,
                                      cnt => cnt.ContentId,
                                      (a, cnt) = new { a, cnt })
                                .Where(z => z.cnt.TypeContent == myTypeContent &
                                            z.cnt.ModeContent == myModeContent)
                                .Select(z => z.cnt);
    

    See my Edulinq blog post on query expressions for more details of how this works, and particularly where the “z” comes from (it’s not really called “z”; it doesn’t have a name as it’s a transparent identifier).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use c# asp-net 4 and ef4. I have a LINQ query which create
I use asp.net 4 c# and ef4. I have this code, it should compile
I use LINQ, C#, EF4. I have this query expression in Linq. I need
May be this is too trivial question. I use C#, asp.net 4, EF4, I
I use Asp.Net 4 and C#, I use EF 4. I have this query,
How can I use ASP.NET inline tags from within a block of JavaScript? For
In my ASP.NET MVC 3 application I am to use EF4.3 as an ORM
[ASP.NET 4.0 / EF 4.1] Hi, I´m trying to use "Linq Methods" to filter
I use asp.net 4, c# and ef4. I would like to know what is
I use c# 4 asp.net and EF 4. I'm precompiling a query, the result

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.