Last post Jan 31, 2015 01:44 AM by Zhi Lv - MSFT
Jan 30, 2015 04:33 AM|K.Ajay Singh|LINK
I am new to entity framework.
My first question is, how to do joining in EF. ?
And I want to know how to do joining of more than two table or joining more than 10 table in entity framework ?
Is there is any performance issue will occur for joining upto 10 table ?
Jan 30, 2015 05:11 AM|AidyF|LINK
There isn't any issue with joining tables this way.
Jan 31, 2015 01:44 AM|Zhi Lv - MSFT|LINK
Welcome to ASP.NET forum.
From your description, it seems that you want to query multiple tables. If that is the case, you could try to use the
GroupJoin methods. Like this:
ObjectSet<SalesOrderHeader> orders = context.SalesOrderHeaders;
ObjectSet<SalesOrderDetail> details = context.SalesOrderDetails;
var query = orders.GroupJoin(details,
order => order.SalesOrderID,
detail => detail.SalesOrderID,
(order, orderGroup) => new
CustomerID = order.SalesOrderID,
OrderCount = orderGroup.Count()
For more details, please refer to the following articles.
Method-Based Query Syntax:
Query Expression Syntax: https://msdn.microsoft.com/en-us/library/vstudio/bb896266(v=vs.100).aspx