By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo ...
-
Upload
lucas-hutchinson -
Category
Documents
-
view
214 -
download
0
Transcript of By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo ...
![Page 1: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/1.jpg)
By: Luis Carranco CIS764 - Fall 2008
![Page 2: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/2.jpg)
What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ?
2
![Page 3: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/3.jpg)
Language Integrated Query for .NET C# 3.0, VB 9.0 Unifies the way data can be retrieved from
any object that implements the IEnumerable<T> interface.◦ Relational data◦ XML◦ Object collections
3
![Page 4: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/4.jpg)
44Image taken from LINQ for Visual C# 2008. Fabio Ferracchiati
![Page 5: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/5.jpg)
5
LINQ to SQLLINQ to SQL
from c in db.Customerswhere c.City == "London"select c.CompanyName
from c in db.Customerswhere c.City == "London"select c.CompanyName
ExecuteExecute(Iteration)(Iteration)
SELECT CompanyNameFROM CustomerWHERE City = 'London'
SELECT CompanyNameFROM CustomerWHERE City = 'London'
SQL QuerySQL Query RowsRows
ObjectsObjects
db.Customers.Add(c1);c2.City = “Seattle";db.Customers.Remove(c3);
db.Customers.Add(c1);c2.City = “Seattle";db.Customers.Remove(c3);
SubmitChanges()SubmitChanges()
INSERT INTO Customer …UPDATE Customer …DELETE FROM Customer …
INSERT INTO Customer …UPDATE Customer …DELETE FROM Customer …
DML DML
![Page 6: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/6.jpg)
6
![Page 7: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/7.jpg)
Only one syntax to retrieve data from any data source
Productivity. Focus on business Compiler checks queries and type safety Avoid SQL, XPath Rich set of instructions to implement
complex queries that support data aggregation, joins, sorting, and much more
7
![Page 8: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/8.jpg)
The LINQ Project http://msdn.microsoft.com/en-us/netframework/aa904594.aspxAccessed 11/16/2008
LINQ for Visual C# 2008. Fabio Claudio Ferracchiati. 1st Edition. Apress.
Programming Microsoft LINQ. Paolo Pialors, Marco Russo. MSPress.
8
![Page 9: By: Luis Carranco CIS764 - Fall 2008. What is LINQ Architecture How does it work? Samples/Demo Why to use LINQ? 2.](https://reader036.fdocuments.us/reader036/viewer/2022070412/5697bf841a28abf838c86ba7/html5/thumbnails/9.jpg)
9