zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

16 results in tag: inheritance

Entity Framework could not be saved. Inherited characteristics

I have implemented some table-per-type inheritance in my data model (basically have a ...BaseEntity... type with all the base information for my items and a ...Employer... type that inherits from the ...BaseEntity... item). Everything appears to be set u...
.net entity-framework inheritance savechanges table-per-type
asked by ChrisHDog

TPT, TPH, or none for Entity Framework inheritance?

I am currently reading about the possibility about using inheritance with Entity Framework. Sometimes I use a approch to type data records and I am not sure if I would use TPT or TPH or none......For example... I have a ecommerce shop which adds shipping,...
entity-framework inheritance
asked by silverfighter

Navigation properties from Entity Framework TPH classes are included.

I've got an EF hierarchy that (dramatically simplified) looks something like this:...class Room { EntityCollection<Session> Sessions; } class Session { EntityCollection<Whiteboard> Whiteboards; EntityReference Room; } class Whiteboard { EntityCollection<W...
entity-framework inheritance navigation-properties
asked by Ken Smith

Select specified columns and return strongly typed without loosing cast using Entity Framework.

I'm trying to do something similar to ...this post... where I don't pull back all columns from a particular entity, however my framework makes use of inheritence and I lose scope of the entity type after it's been cast to an anonymous type. ...The structu...
asp.net-mvc entity-framework inheritance linq linq-to-sql
asked by XVargas

The type 'Company.Model.User' and the type 'Company.Core.Model.User' both have the same simple name of 'User' and so cannot be used in the same model

I have a base entity class ...MyCompany.Core.Model.User... which is to be used for common properties of a ...User... entity:...public class User { public string Username { get; set; } public string Usercode { get; set; } } ...I also have a base ma...
ef-code-first entity entity-framework entity-framework-6 inheritance
asked by Brett Postin

Entity Framework Polymorphic associations

I'm going to use Entity Framework soon for a Booking System ( made from scratch )....I have been doing a few Prototypes, trying to figure out what I want to do before the project is started (I'm still discussing requirements etc. with the client)....Consi...
c# entity-framework inheritance interface polymorphism
asked by André Snede Kock

Entity Framework DB-First, implement inheritance

I'm trying to implement inheritance using entity framework 6.0 and database first approach. OK, let's say I have a ...Person... and an ...Organization... entity like below:...// a simplified version of organization entity public class Organization { p...
c# ef-database-first entity-framework inheritance
asked by Ashkan

Entity Framework 6 - inheritance and navigation properties on base class

I have a problem with navigation properties and inheritance....This is my problem: I have a base ...Person... class and classes ...User... and ...Worker... which inherit from ...Person.... On the DB level I'm using single table inheritance or table per hi...
c# entity-framework entity-framework-6 inheritance orm
asked by ZolaKt

Entity Framework Table Per Class Inheritance

I am trying to implement a history table for an entity in EF6, code first....I figured there would be a way to do this with inheritance. The history table, which is a derived type of the actual table entity, just containing straight copies of all the prop...
c# entity-framework entity-framework-6 inheritance sql
asked by tigerswithguitars

How can I mix TPH and TPT in Entity Framework 6?

Initial situation...I have an application that uses an existing database, currently using ...NHibernate... as O/R-Mapper.... Now I need to migrate to ...Entity Framework 6.1.1... using ...Code First... and ...Fluent API Configuration.......But now I have ...
c# ef-code-first entity-framework entity-framework-6 inheritance
asked by Stephan Bauer

Database first , How to implement inheritance in EF6

I'm trying to implement inheritance using entity framework 6.0 and database first approach. The reason I want to implement inheritance is because I want to add these below fields in all of my tables....They are :(...Actually in the common database design,...
entity-framework entity-framework-6 inheritance
asked by Joe.wang

Table Per Concrete Type (TPC) Inheritance in Entity Framework 6 (EF6)

In an effort to avoid the use of Table Per Hierarchy (TPH) I have been looking at examples of how best to implement Table-Per-Concrete Class (TPC) inheritance in my database model. I came across the ...official documentation... and ...this article.......B...
asp.net c# entity-framework inheritance sql-server
asked by Nicholas

New inherited class gets its property name renamed on migration with EF Code First

I'm using Entity Framework Code First with inheritance to define my classes each implementing an abstract class containing common properties all of them should have....I ran into a problem when I wanted to add new one to batch. All inherited classes have ...
c# entity-framework entity-framework-6 inheritance
asked by Bogac

Entity Framework 6 Runtime Error: "given key was not present in the dictionary"

I am writing an ASP.Net app using EF6 code-first and table per hierarchy...I get this error whenever I attempt to do anything meaningful with my dbcontext (such as a query, update, etc.):...{ "Message": "An error has occurred.", "ExceptionMessage": "A...
asp.net c# entity-framework entity-framework-6 inheritance
asked by jth41

Entity Framework: Query Multiple Types

I have a EF6 code-first model with inheritance, for example:...[Table("Things")] abstract class AbstractThing { public int ThingId { get; set; } public string Color { get; set; } } class Car : AbstractThing { public string Brand { get; set; } } ...
entity-framework-6 inheritance table-per-hierarchy
asked by Efrain

How to automatically set CreatedOn fields with Entity Framework on saved entity and its child properties

Whenever I call ...databaseContext.SaveChanges()..., before data is saved by Entity Framework, I need all objects and their child classes to have the ...CreatedOn... field populated with ...DateTime.Now().......Details: I have a ...BaseEntity... class tha...
c# entity-framework entity-framework-6 inheritance
asked by InspiredBy

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!