10 July 2013

LINQ expressions return type is IEnumerable Collection objects

Hi All,

Recently I came across a situation where-in I was asked by my colleague as what is the LINQ expression's return type. I happened to answer him that it's IEnumerable collection.

May be I needed to do a research until when I found this link...
The summary of the blog by Mr.Charlie Calvert is as follows:
"LINQ query is deferred query evaluation, i.e. the query expression executes when we iterate thru or access its contents until then the query is not executed.
We generally write a LINQ query as
from x in y
where x is the content of the datasource y. And this datasource must implement the IEnumerable interface.
Also the LINQ objects are Composable meaning that the output of a LINQ query can be made as an input to another LINQ query.This is possibly because the LINQ query only accepts objects that implement IEnumerable interface as datasources and also returns the return type as IEnumerable objects. Hence this is possible."

Thanks for reading..
And don't forget to share your valuable feedback as it helps us to know that my effort is useful...and also helps me in improving if pointed out my drawbacks.


With Love,
Satish Bommideni
LINQ expressions return type is IEnumerable Collection objectsSocialTwist Tell-a-Friend

No comments:

 
#footer-column-container { clear:both; } .footer-column { padding: 10px; }