.Net Hive

A blog about Microsoft .Net Platform & other industry happenings

Data Access with ADO.NET 3.5 – LINQ to SQL

Alright, going back to our series where we discussed LINQ and all related extensions. Lat time we discussed LINQ itself. Today, we are going to talk about LINQ to SQL extension.

Well LINQ to SQL is more than just a LINQ implementation for relational databases; it includes a very easy to use graphical object/relational mapping tool. This tool generates an entity class for each table you select from the SQL Server database to which the project connects. The tool also generates an association that relates to each foreign key constraint. Associations eliminate the need to specify joins in LINQ queries that include projections of fields from related tables. The ability to navigate associations is an important feature of LINQ implementations and the Entity Framework.

The advantage of moving from the relational model of tables, rows, and keys to the entity model of entity classes, entity instances, and associations is that entities usually do represent business objects, such as customers, partners, vendors, employees, products, and services. An entity model enables developers to design real world objects with custom properties, associations, and behaviors suited to the organization’s business processes.

LINQ to SQL is intended for 1:1 mapping of tables:entities, although it does have limited support for entity inheritance of the Table per Hierarchy (TPH) type based on discriminator columns. Read only entities can be based on views or stored procedures. The Entity Framework’s Entity Data Model supports joining multiple tables to create a single updatable entity, as well as several types of entity inheritance.

This entry covers a brief overview about LINQ to SQL extension or you can say a LINQ to SQL in a nutshell. I will try to give some examples about the auto generated classes for entities which entity framework create, in some later post.

Till than, Happy Reading.

Waqas Ahmed

Advertisements

Filed under: .Net, , ,

Pages

Categories

Archives

.Net Hive @ Twitter

Blog Directory by Blog Flux
Computers/Tech blogs