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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:51:05+00:00 2026-05-27T03:51:05+00:00

I have a LinkTable named: BlogsBlogPosts that relates two other tables named: Blogs and

  • 0

I have a LinkTable named: BlogsBlogPosts that relates two other tables named: Blogs and BlogPosts together, I want the link table to appear in the list of entities and There will be two one to many relationships defined on the linktable am I correct to define it like this?:

public class BlogsBlogPostConfiguration : EntityTypeConfiguration<BlogsBlogPost>
{
    public BlogsBlogPostConfiguration()
    {
        this.HasRequired(bb => bb.Blog)
        .WithMany(b => b.BlogsBlogPosts)
        .HasForeignKey(bb =>bb.BlogID);

        this.HasRequired(bb => bb.BlogPost)
       .WithMany(bp => bp.BlogsBlogPosts)
       .HasForeignKey(bb => bb.BlogPostID);
    }
}
  • 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-27T03:51:06+00:00Added an answer on May 27, 2026 at 3:51 am

    Yes. The only question which remains for me is: What about the primary key property of BlogsBlogPost? Two options:

    • You either have a distinct key property like public int BlogsBlogPostID { get; set; } or public int ID { get; set; } in this entity. In this case combinations of (BlogID, BlogPostID) don’t have to be unique.

    • Or you have a composite key consisting of (BlogID, BlogPostID). You would have to mark this with the [Key] annotation or define it in Fluent API:

      this.HasKey(bbp => new { bbp.BlogID, bbp.BlogPostID });
      

      Now combinations of (BlogID, BlogPostID) must be unique. This is more of a “many-to-many relationship with additional data in the link table” type of relationship.

    Both models are possible. Which to use depends on your business needs.

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

Sidebar

Related Questions

I currently have two tables similar to users and programs that are linked through
I have 2 tables: release_servers and release_components I have a link table release_server_to_components I
I have two tables User and UserRole which are they connected using a link
I'm creating a 'similar items' link table. i have a 2 column table. both
I have a PrivilegeGroup table, a Privileges table and a link table because the
I have a table with two UITableViewCell (and one label on each). The idea
I have a table named Books which contains 3 columns. TableName: Books Columns: BookId
I have 2 tables in database User and Link. The userid is a foreign
I have a very simple link table set up, I need to delete rows
Suppose I have a simple MySQL table that looks like this: CREATE TABLE `my_table`

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.