Tuesday, April 29, 2008

LINQ - Delay/Lazy Loading


This blog post summarizes the overview of LINQ.

Below are the new features been introduced in Orcas

§ Automatic Properties

§ Object Initializers

§ Collection Initializers

§ Extesnion Methods

§ Lambda Expressions - p => expressions

§ Query Syntax

§ Anonymous Types

§ Var Keyword

These language features help in making query against relational data. This overall querying programming model is called as "LINQ" - which stands for .NET Language Integrated Query.

Delay/Lazy Loading:

· LINQ to SQL enables developers to specify whether the properties (Column Value) on entities should be prefetched or delay/lazy-loaded on first access.

· We can customize the default Pre-Fetch/Delay-Load Rules for entity properties by selecting any entity property or association in the designer, and then within the property-grid set the "Delay Loaded" property to true or false.

· We can also override this via code when we perform LINQ queries on the entity class.



· Picture" column which stores a (potentially large) binary image. Such retrival of the binary image from the database must happen when we are actually using it (and not when doing a simply query just to list the category names in a list).


Hope this helps.

Thanks & Regards,

Arun Manglick || Tech Lead

No comments:

Post a Comment