Upload
melanie-kearney
View
218
Download
2
Embed Size (px)
Citation preview
LINQ
Stefan Flöring
Department für InformatikCarl von Ossietzky Universität Oldenburg
2
3
.NET Language Integrated Query
LINQLanguage Integrate Query
LINQ toObjects
LINQ to SQL
LINQ to XML
C# 3.0 VB 9.0 Weitere (F# …)
Relational
Objekte
<xml
<customer/></xml>
XML
4
Demo
5
Zusammenfassung
from c in db.Customerswhere c.City == „London“Select c.CompanyName
Anwendung
LINQ to SQL
SQLServer
Enumerate
SQL Query Oder SProc
Tupel
SELECT CompanyNameFROM CustomerWHERE City = „London“
db.Customers.Add(d);c2.City = „Aurich“;
SubmitChanges()
DML
INSERT INTO Customer…UPDATE Customer…
6
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();
Parallel FX und Parallel LINQ