 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

March 16th, 2012, 12:18 AM
|
|
Friend of Wrox
|
|
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
|
|
The outer and inner join LINQ question.
Reading through Chapter 14 of your book, I was wondering how does LINQ simulate or emulate inner and outer joins? How does interact and interface with stored procedures?
Thanks once again!
|
|

September 13th, 2012, 11:34 PM
|
|
Authorized User
|
|
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
|
|
LINQ in the Entity Framework (Chapter 14)
Hello,
Following on vbboyd's question about no join examples in Chapter 14 ...
I have used LINQ-To-SQL once before, but was under the impression that, although the syntax is similar for LINQ in the Entity Framework, it still is different. Is the syntax, in fact, the same? (the weblink Imar gave doesn't explicitly mention Entity Framwork). In other words, are LINQ statements the same across any type of LINQ-To-X
Here is my conceptual understanding. Someone please advise if this is correct: By adding the .Include() method after the entity, you are in effect doing an Inner Join, as now you have access to the related rows in the "included" entity. I am fuzzy on how you would perform the outter join unless it's the same as LINQ-To-SQL.
Thanks everyone.
|
|

September 16th, 2012, 09:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
Is the syntax, in fact, the same?
|
Yes, LINQ as a query language is a stand alone concept that can be used by, for example, L2S and LINQ to Entities. The query language itself is the same in both implementations although the methods they support can be different. Also, managing objects (creating new ones for example) is different because that's not a LINQ feature but an ORM feature.
For an example of an OUTER JOIN with LINQ
http://www.hookedonlinq.com/OuterJoinSample.ashx
And yes, by calling Include you get an INNER JOIN although you don't have to use Include to use an INNER JOIN.
Cheers,
Imar
|
|

September 16th, 2012, 07:01 PM
|
|
Authorized User
|
|
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
|
|
LINQ Concepts
This is a good post; it's important to understand the concepts behind the tools and implementations. Now I understand why LINQ-To-SQL seemed different than LINQ-To-Entities.
Different methods are exposed, and different constructs are used to manage data objects, depending on which you are using, but the language is the same.
This sheds some clarity on the subject. Thank you.
|
|
 |
|