All About LINQ



All About LINQ
May 2007 Integrated Query Language (linq) refers to the characteristics of the collection in the Microsoft. NET framework 3.5, enables developers to embed doubt, in memory or external data directly into their programs. Linq can close the gap between programming objects and data provide a common query facilities of different types of data, built. NET framework.

How linq work? Linq integration enquiry function as a programming language. Here is composed linq: Letter of Intent wavelength wavelength expressions embedded functions, the operation of the import value. For example, the wavelength of the "S => s * 1.10" can be changed into "Given s, s return multiplied by 1.10." Similarly, the wavelength of "employee => employee.salary> 50000" can be read "to their employees, or employee.salary return more than 50,000 yuan." On behalf of the LAMBDA expression through other methods. Unlike delegates, but the words may wavelength expression through tree (relative interleukin-executable), and other means, the ability of the so-called method, the expression of their own.

Query methods doubt built for the use of a method, it is understandable from the system, for example, the "Choice", "Where" and "orderby" . Most of the enquiries, and the return to strong typing iteration (ienumerable). In addition to a number of methods for decentralization or ¦Ë expression, and apply it to the members of input iterators. For example, if the method is a function returns a Boolean value (such as Chinas LAMBDA expression "employee => employee.salary> 50000"), and applied to the importation of iteration, a new iteration return Only these types of values, function evaluation to correct. Similarly, the shape of a select input iterators taken by the function, which may return to a different type (such as "employees => employee.salary * 1.10"), and applied to the input iterators. Through the output method, and as input to select the method, we end up with an iterative for the return of wages, an increase of about 10 percentage points, all employees with current salary than 50,000 US dollars.

[Click image to enlarge] Through examples linq comprehensions in the language C # and VB.

extension method extension method, the external classes, methods to determine the cases in the preparation of the existing classes. For example, you can define a method of expansion "was extendedprice" also unitprice * to the existing class of orderitem, then you can call this method orderitem just like any other method. Extension is a static approach and take an example of an existing section of the working class as an argument, but it seems to them that as an example, the existing class.

There is a public static class, system.linq.enumerable, namely, to implement the standard query method for ienumerable extension of the method. Therefore, by including system.linq name space, query method seems to be any collection, array or sequence of values, a ienumerable.

Enquiries comprehensions doubt that the way will be completed from any programming language calling for the LAMBDA method with the appropriate expression. Enquiries comprehensions Key words added to the C # and VB common query operators, the choice of where and orderby groupby to common queries can be written and not explicitly requested compensation or designated LAMBDA expressions.

Anonymous types and object initialization expression a result, the choice is a ienumerable operator, but it may not easy to identify a type for every possible projection. Anonymous types that can be embedded definition on the basis of members from the other structures and values, if not supply the names of types or members.

Functional programming linq expression provide a functional definition of the desired data, rather than prescribing a set of procedures for high yield results. Expression of the entire composition is not, or until it explicitly enumerated converted into a list. The linq implemented to select the best strategy for future action and demand results. Therefore, the implementation of more than linq relations stores retrieval table and loop through the entire results for each individual expression. Instead, the whole expression linq be converted into SQL query, signed at the store through the association engine, and match results in local terms, the correct forecast, orders and groups of applications.

Linq implementation addition to the default implementation of the enquiry service operators ienumerable a net 3.5 framework, support for the relationship between the XML data in SQL Server or exposed through a conceptual model of the entity to extend ado.net data providers and data a ado.net data sets.


Latest Industry News:
- WiMAX Set to Explode
- VMworld Shines Spotlight on Virtualization
- Microsoft
- Palladium on Display at WinHEC
- Microsoft Has 2 Security Bulletins on Tap for Next Week
- Academics Joining Ranks Declaring 'E-Mail Bankruptcy'
- Excel 2002 Core
- Is Campus IT Ready for Rita?
- Ballmer Defends Need to Invest, Innovate
- 640-801: The New CCNA Exam
- Microsoft's First, Best Customer
- Back to Basics Quiz
- EU To Deepen Google-DoubleClick Inquiry
- Tour de SQL Part I
- Packaging, Deploying Virtual Servers VMRC Client
- Awaiting a Vista Bounce
- How Microsoft Eats its Own Dogfood
- Heroix Supports Security with RoboMon
- Intel Opens Floodgates on Xeon-Related Products
- Prosoft Offers Intel ICISs CIW Fast Track