Folie 1

Report
LINQ
Stefan Flöring
Department für Informatik
Carl von Ossietzky Universität Oldenburg
2
LINQ
Language Integrate Query
C# 3.0
VB 9.0
Weitere (F# …)
.NET Language Integrated Query
LINQ to
Objects
LINQ to
SQL
LINQ to
XML
<xml
<customer/>
</xml>
Objekte
Relation
al
XML
3
Demo
4
Zusammenfassung
from c in db.Customers
where c.City == „London“
Select c.CompanyName
db.Customers.Add(d);
c2.City = „Aurich“;
Anwendung
Enumerate
SubmitChanges()
LINQ to SQL
SQL Query Tupel
Oder SProc
SELECT CompanyName
FROM Customer
WHERE City = „London“
SQLServer
DML
INSERT
INTO
Customer…
UPDATE Customer…
5
Parallel FX und Parallel LINQ
using System.Concurrency;
…
for (int i = 0; i < 100; i++) { a[i] = a[i]*a[i]; }
Parallel.For(0, 100, delegate(int i) {
a[i] = a[i]*a[i];
});
…
var query = (from c in db.Customers
select c).AsParallel();
6

similar documents