Page 1 of 1

entity set type inerhit from base?

Posted: Thu 22 Jun 2017 08:25
by Q.X
entity framework

base class is: listOrder
derived class is:listItktOrder
type: TPT

why the class "listItktOrder" entity set is not listItktOrders but ListOrders?

Re: entity set type inerhit from base?

Posted: Fri 23 Jun 2017 15:59
by Pinturiccio
Yes, EntitySet is created for the root class of a hierarchy.
A query to a descendant class looks like the following:

Code: Select all

var context = new MyContext();
var query = context.ListOrders.OfType<listItktOrder>();

Re: entity set type inerhit from base?

Posted: Wed 28 Jun 2017 14:10
by Q.X
Pinturiccio wrote:Yes, EntitySet is created for the root class of a hierarchy.
A query to a descendant class looks like the following:

Code: Select all

var context = new MyContext();
var query = context.ListOrders.OfType<listItktOrder>();
thx