c# - Mapping stored procedures in EF 6 to abstract types -
my data model uses inheritance (which i'm trying change...) looks like:
abstract class entity { public int foo { get; set; } } class derived1 : entity { public int widgetcount { get; set; } } class derived2 : entity { public int barcount { get; set; } }
i retrieve results of query (or stored proc) returns entity, .executestorecommand<t>
.translate<t>
, .sqlquery<t>
fail because can't create entities, yet query against dbcontext's dbset<entity>
works , returns objects of correct type (either derived1 or derived2).
is there way me query entities without using dbset?
Comments
Post a Comment