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

  • Home
  • SEARCH
  • 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 220695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:57:48+00:00 2026-05-11T18:57:48+00:00

I am trying here to make a few left joins into a linq query

  • 0

I am trying here to make a few left joins into a linq query but I’d say I rather have no idea how to materialize this idea.

Basically here is the 3 database structures I want to play with.

<tags>
id | name

<events_tags>
tag_id | event_id

<events>
id | name | some-other-fields

so for each events there is a one-to-many relation with tags, an event can then have one or more tags.

I’d like to know how to search an event based on a tag or how can I, based from an event id know the associated tags ?

  • 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-11T18:57:48+00:00Added an answer on May 11, 2026 at 6:57 pm

    To search event by tag, I think you can write something like:

    var tagsIds = from t in DataContext.Tags
                  where t.Name == "sometag"
                  select t.id;
    
    var eventsByTag = from et in DataContext.EventTags
                      where tagsIds.Contains(et.tag_id)
                      select et.Event;
    

    To get the tags for an event:

    var tagsByEvent = from et in myEvent.EventTags
                      select et.Tag;
    

    For the latter, for convenience, you can put it in a property of Events:

    public List<Tag> Tags
    {
       get
       {
          List<Tag> tags = (from et in this.EventTags
                            select et.Tag).ToList();
          return tags;
       }
    }
    

    And just refer to myEvent.Tags where you need them.

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

Sidebar

Related Questions

I am trying to make a few barplots in R. Here is what I
For few days I have been trying to figure out how to use make
am trying to make a worker thread using MFC so here is the codes:
Trying to make a toggle button that hides/shows the right window/pane. Here is a
Here is a page I am trying to make print friendly, so it will
I'm trying to make 'dark' area when my modal window is opened. Here is
I am trying to make the smallest menu with submenus possible. So far, here
Here is jsfiddle ! I am trying to make user page where he can
Here's the code I'm currently working with: http://jsfiddle.net/gEMCm/ I'm trying to make an image
I'm trying to make just a few minor tweaks to the default template of

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.