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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:48:50+00:00 2026-06-06T09:48:50+00:00

I have the following situation: An Conversations entity/table which has multiple Tags associated to

  • 0

I have the following situation:
An “Conversations” entity/table which has multiple Tags associated to it.
Tag is also an entity/table – the key/id is tagName (a string).

On the client side (javascript) I work with arrays of string when dealing with Tags.

Now I want want to retrieve all the conversations that have all given tags.


The input is an array of strings and the output should be a collection of Conversations

I’ve tried:

var filterTags = new List<EFModels.Tag>();
foreach (var tagName in tags)
            {
               filterTags.Add(new EFModels.Tag() { Name = tagName});
            }

var conversations = from c in context.Conversations where !c.Tags.Except(filterTags).Any() select c ;

The problem with this is: Unable to create a constant value of type 'EFModels.Tag'. Only primitive types or enumeration types are supported in this context – which makes sense.

Now how can I do my select? What’s the best approach? (I still want to use linq and not write the sql select)

  • 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-06-06T09:48:52+00:00Added an answer on June 6, 2026 at 9:48 am

    You can project c.Tags to tag name.

    I guess it will look like that

    var conversations = from c in context.Conversations where !c.Tags.Select(tag => tag.Name ).Except(filterTags).Any() select c ;
    

    Where filterTags is the list of strings containing the names of the tags

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

Sidebar

Related Questions

I have the following situation: I have site A, which has it's Mercurial repo,
I have following situation, String a=<em>crawler</em> <em> Yeahhhhh </em></a></h3><table; System.out.println(a.indexOf(</em>)); It returns the 11
I have the following situation in code, which I suspect may be a bit
I have the following situation: <input id=upload_trigger_btn type=file name=files[] multiple> <a type=submit class=button-normal-12px-ffffff href=#><span>Add
I have the following situation. I have a database of transactions about multiple contracts.
I have the following situation: There is a windows folder that has been mounted
I have the following situation: I have a work sheet which contains a list
I have the following situation: Page1.aspx is based on a master page and has
I have following situation. A main table and many other tables linked together with
I have following situation. I have a class for accounts, each account has a

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.