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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:43:09+00:00 2026-06-06T21:43:09+00:00

I have a UserClasses , Screens and Workflow tables. The Workflow table is the

  • 0

I have a UserClasses, Screens and Workflow tables. The Workflow table is the association table between the UserClasses and Screens tables. Here are their structures…

UserClasses
- UserClassID (int PK)
- UserClass (string)

Screens
- ScreenID (int PK)
- ScreenName (string)

Workflow
- UserClassificationID
- ScreenID

I have the following data in the UserClasses table (Id and name):

- 1 UserClassification1
- 2 UserClassification2
- 3 UserClassification3
- 4 UserClassification4
- 5 UserClassification5

I have the following data in the Screens table (Id and name):

- 1 Screen1
- 2 Screen2
- 3 Screen3

I have the following data in the Workflow table (UserClassificationID and ScreenID):

1 1
1 2

By looking at the data Screen3 is not associated to a user classification. This is what I need, a list of all the screens that are not associated to a given user classification. How would I do this?

Additional information regarding my setup. The 2 classes that I have defined for the UserClasses and Screens tables:

public class UserClassification : IEntity
{
     public int Id { get; set; }
     public string Name { get; set; }
     public virtual ICollection<Screen> Screens { get; set; }
}

public class Screen : IEntity
{
     public int Id { get; set; }
     public string Name { get; set; }
     public virtual ICollection<UserClassification> UserClassifications { get; set; }
}

Here are the configurations classes that is used in my database context class:

class ScreenConfiguration : EntityTypeConfiguration<Screen>]
{
     internal ScreenConfiguration()
     {
          this.Property(x => x.Id).HasColumnName("ScreenID");
          this.Property(x => x.Name).HasColumnName("ScreenName");
     }
}

class UserClassificationConfiguration : EntityTypeConfiguration<UserClassification>
{
     internal UserClassificationConfiguration()
     {
          this.ToTable("UserClasses");
          this.Property(x => x.Id).HasColumnName("UserClassID");
          this.Property(x => x.Name).HasColumnName("UserClass");
          this.HasMany(i => i.Screens)
               .WithMany(c => c.UserClassifications)
               .Map(mc =>
               {
                    mc.MapLeftKey("UserClassificationID");
                    mc.MapRightKey("ScreenID");
                    mc.ToTable("Workflow");
               });
     }
}

So given the above information I need to return a user classification object with a list of screens that are not associated to this user classification, in this case that would be a list of 1 screen item. How would I do something like this?

This is how I return a user classification object with a list of screens that are in the association table:

return DbContext.UserClasses
     .Include("Screens")
     .SingleOrDefault(x => x.Id == userClassificationId);
  • 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-06T21:43:11+00:00Added an answer on June 6, 2026 at 9:43 pm

    What about ?

    from s in DbContext.Screens
    where s.UserClassifications.Count() == 0
    select s
    

    hope this helps

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

Sidebar

Related Questions

Have a xml string, goal is to replace an xml element value to a
Have advancements in CPU design like dynamic instruction scheduling narrowed the performance gap between
have an an array String classname[]={'a','b','c','d'}; ArrayAdapter<CharSequence> adapterClasses = new ArrayAdapter<CharSequence>( getApplicationContext(), R.layout.spinner_item_class, R.id.spinnerclasstxt,
Have their been any studies related to the importance of how good a software
Have such a problem, hope you'll help me.. Can't find anywhere. Here is the
Have an issue with marshall and unmarshall readers and writers. So here it is.
Have a look at the following code. The goal here is to return a
have a small javscript that users can include into their sites like so: <script
Have a string: myString = '<p>Phone Number:</p><p>706-878-8888</p>' Trying to regex out all HTML tags,
Have two UIBarButtonItems want to make it as one UIBarButtonItem and toggle between them

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.