Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: Upgraded to EF6; Includes Inherited Automatic Read-Only Properties?

$
0
0
Hi,

I recently upgraded a project to EF6. As a result, my database now includes columns for automatic read-only properties that are defined in my code-first models' base class.

For example, I have defined a class such as the following and added a corresponding DbSet property to my DbContext class.
publicclass Foo : Bar
{
  [Key]
  publicint Id { get; set; }
}
The base class is defined as follows:
publicabstractclass Bar
{
  publicbool IsValid
  {
    get;
    privateset;
  }
}
And now the Foo table in my database has an IsValid column that wasn't generated by EF5.

Is this a bug or is it by design?
If it's by design, then is there a way to globally turn off this new behavior so that I can continue using automatic read-only properties without having to specify NotMapped on each of them?

I've already read the following discussion and it seems like it applies, but I don't know if these changes were actually implemented in EF6:

http://entityframework.codeplex.com/wikipage?title=Design%20Meeting%20Notes%20-%20February%2020%2C%202013

Thanks,
Dave

Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>