If I have an EF query like:
var model = testContext.PurchaseOrders
.Include(order => order.CompanyAccountingCodeNumber)
.Include(order => order.CompanyAccountingCodeNumber.AccountingCode);
Is there anyway to find out the types of the EF entities involved in the specific query. For example this one involves:
Test.Models.PurchaseOrder
Test.Models.CompanyAccountingCodeNumber
Test.Models.AccountingCode
So I would like to be able to get an IEnumerable
of Types so I can get the namespace etc?
I am assuming that something like this is possible - Automapper supports Project().To<>
which figures out which includes are required. So I guess using reflection of the include properties would give me their types.