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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:40:35+00:00 2026-05-25T06:40:35+00:00

I am not sure what I am doing wrong here, but I am having

  • 0

I am not sure what I am doing wrong here, but I am having an issue with multiple inheritance and building my model. I get the error “The property ‘Id’ is not a declared property on type…“. Everything worked fine before I added the ContextEntity class and I had a TPC model. Each (non abstract)derived entity had it’s own ID and own table. The other classes always existed and my mappings worked fine. Here are my classes:

public abstract class Entity
    {
        public virtual Guid Id { get; set; } 
        public DateTime DateCreated { get; set; }
        public DateTime DateModified { get; set; }
        public EntityStatus EntityStatus { get; set; }
        public byte[] RowVersion { get; set; }
    }


    public abstract class ContextEntity : Entity
    {
        public string Description { get; set; }
        public ICollection<Comment> Comments { get; set; }
        public virtual Contact Owner { get; set; }
    }


    public abstract class Document : ContextEntity
    {

        public virtual Subscription Subscription { get; set; }

    }

    //This is the Class I want as a table
    public class Rfi : Document
    {
        public string Number { get; set; }
        public string Subject { get; set; }

    }

Before I had the ContextEntity I only had Entity. Not all my entities will use the ContextEntity. I have this mapping file:

public class EntityConfiguration<TEntity> : EntityTypeConfiguration<TEntity>
    where TEntity : Entity
    {
        protected EntityConfiguration()
        {
            HasKey(e => e.Id);

            Property(e => e.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(e => e.RowVersion).IsRowVersion();
        }
    }

When I just had the Entity base type it worked great. So I thought I would add another configuration mapper like this:

public class ContextEntityConfiguration<TEntity> : EntityTypeConfiguration<TEntity>
        where TEntity : ContextEntity
    {
        protected BridgeEntityConfiguration()
        {

            HasKey(e => e.Id);

            Property(e => e.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(e => e.RowVersion).IsRowVersion();
            HasMany(e => e.Comments).WithMany().Map(m =>
                                                        {
                                                            m.MapLeftKey("CommentId");
                                                            m.MapRightKey("EntityId");
                                                            m.ToTable("Entity_Comments");
                                                        });
            HasMany(e => e.Attachments).WithMany().Map(m =>
                                                           {
                                                               m.MapLeftKey("AttachmentId");
                                                               m.MapRightKey("EntityId");
                                                               m.ToTable("Entity_Attachments");
                                                           });
        }
    }

My Derive mapping class looks like this:

RfiMapping: ContextEntityConfiguration<Rfi>

I am guessing EF doesn’t know what to do with all the nested base classes?

  • 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-25T06:40:35+00:00Added an answer on May 25, 2026 at 6:40 am

    The issue was with the Subscription property in my Document class. In that class was a property that needed to be null-able. Once I added the mapping for the Subscription class and updated the null able property everything worked fine. Not sure why it was giving me an error on my Rfi class, but the issue was not in that class.

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

Sidebar

Related Questions

I have a feeling I'm doing something wrong here, but I'm not quite sure
I'm not sure what I'm doing wrong here but I want to create scope
Not sure what I'm doing wrong here, but say I have: foo.h class foo
I know this probably really simple but Im not sure what im doing wrong...
I'm not sure what I am doing wrong, but the text for my JPanels
I'm trying to free g_strdup but I'm not sure what I'm doing wrong. Using
Am not sure if what I am doing is absolutely correct. But here goes:
Rails noob here so I'm not sure what I'm doing wrong. We're replacing a
Not sure what I'm doing wrong here, all I thought I had to down
Not sure what I'm doing wrong with .live() $(function(){ var wrapper = $('#trailer_wrapper'); var

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.