0
votes

I have a task which requires me to return all models from a table using inheritance (TPH).

I have a model class called WorkflowInstance and a derived class CustomWorkflowInstance (which has a string property). There is a discriminator of course.

I want to know of a way where I can return all the elements without considering the discriminator

Not sure I understand the question. The whole point of TPH (and TPT) is that Set<WorkflowInstance>() returns all base and derived items (everything which is a base entity). - Ivan Stoev
the WorkflowInstance is actually from dll and I had to add a string property so I created CustomWorkflowInstance and added the new property. I thought by doing set<WorkflowInstance> I would return everything but it only returns that model and not everything (in sql log, the query has where discriminator = ) and that is not what I want - AmineMraihi
var workflows = db.Set<WorkflowInstance>() -> var customWorkflows = workflows.OfType<CustomWorkflowInstance>(). - Alexander Petrov