Linq is a set of technologies that work together to solve a similar family of problems. In all of them, you have a data source (xml file or files, the contents of the database, a collection of objects in memory), and you want to get some or all of this data and act on it somehow. Linq works on the commonality of this many tasks, such that:
var brithdays = from user in users where
user.dob.Date == DateTime.Today && user.ReceiveMails
select new{user.Firstname, user.Lastname, user.Email};
foreach(bdUser in birthdays)
SendBirthdayMail(bdUser.Firstname, bdUser.Lastname, bdUser.Email);
And the equivalent (explicit use of Linq-related classes and methods with traditional C # syntax):
var birthdays = users
.Where(user => user.dob.Date == DateTime.Today)
.Select(user => new{user.Firstname, user.Lastname, user.Email});
foreach(bdUser in birthdays)
SendBirthdayMail(bdUser.Firstname, bdUser.Lastname, bdUser.Email);
, , , XML- .
, users. , , linq-to-objects, System.Data.Linq.Table, linq sql. , SQL-, .
ParallelQuery - .AsParallel - -memroy, ( ), - , .
, - . , .
.
-, , , , . , .
-, . , 4- , 4- (4 , , , 8 , ). , (, - "-" ), . - , , .
-, - (, ) , , ..
-, , , , , .
-, , (, - - ), . , , , , 16 , . , .
- , , .