Linq

Linq?

Here I ll introduce Linq (Language INtegrated Query).  Linq, in simple language, is a way to access to data.  The data can be Database, XML, Entities etc.  Linq is a convenient way to access to different type data.  It ll come in handy through out your coding to master this.

Linq has query and method.

Query

Let’s cover query first.

The basic Linq query look like this;

For starter here are basic terms to cover

from, where, select, group, orderby, into, join.

from

This is where you specify the source.

The basic use of form is;

from [your scope variable] in [data source]

where

This is where you state condition of your selection of data.

select

This is to specify fields and or object you want to select within your scope variable.  At example above, I have specified Title field in my scope variable a, but if you want the whole data you can simply say;

Method

To note; what you can write in query, you can write in Method statement, but not all thing you can write in Method is available in query. And I ll cover this more later.

Here is Linq with method statements.

 

 

Leave a Reply