I'm trying to select only 2 columns from the navigation properties but unable to do it, can anyone let me know how can I achieve this?
It works good default way(selecting all columns) :
var productreceipts = db.productreceipts.Include(p => p.employee).Include(p => p.productmaster).Include(p => p.vendor);
What I want:
Select only 2 columns form each of employee, productmaster, vendor tables.
I know how to select if I have only one table:
var productreceipt = db.productreceipts.Select(p => new { p.ReceiptId, p.ReceivedBy });
EDIT : I want to select all properties of first table(productreceipts) and only a few selected from others.
Any help will be much appreciated.
Thanks in advance.
.Select(p => new { propertyName = p.productmaster.SomeProperty }
- user3559349