I would like to retrieve the Type
of entities that implement a specific interface. I want to retrive this inside the OnModelCreating method.
Example Assume that I have the following entity
public class Product : IProductBase {
public int ProductId {get;set;}
}
I also have a entity that does not implement IProductBase
for example:
Public class ProductInventory {
public int Id {get;set;}
}
In the following onModelCreating I want to be able to retrieve all the Type(s)
of entities that have implemented IProductBase
interface.
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
I have tried few things such as trying to retrieve the ClrType. But that does not seem to work.