the object relational designer

Post on 14-Nov-2014

125 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

The Object Relational Designer

The Object Relational Designer

• A graphical user tool for generating entity classes that runs inside of Visual Studio.

• This tool is called the Object Relational Designer, but you will commonly see it referred to as the LINQ to SQL Designer, the O/R Designer, or even DLinq Designer.

• SQLMetal is designed to generate entity classes for all tables in a database.

• For a more selective approach with a graphical user interface, the Object Relational Designer is just the ticket.

• The designer gives the developer drag and drop design-time entity class modeling.

Connecting the DataContext to the Database

Adding an Entity Class

referred to as an association in LINQ to SQL, between the Customers and Orders tables, as defined by the FK_Orders_Customers foreign key constraint that exists in the Northwind database.

did not specify any connection information when instantiating the NorthwindDataContext object.

We will Add Insert Store Procedure

Use SQLMetal and the O/R Designer Together

• Because SQLMetal’s DBML intermediate file format shares the same XML schema as the Object Relational Designer’s format, it is completely possible to use them together.

• you could generate a DBML intermediate file for a database using SQLMetal, and then load that file into the O/R Designer to tweak any entity class or entity class property names you desire. This approach provides a simple way to generate entity classes for an entire database, yet makes it simple to modify what you would like.

Part-2

• LINQ to SQL, a new part of ADO.NET that supports Language Integrated Query, allowing you to query and manipulate objects associated with database tables.

• It eliminates the traditional mismatch between database tables and your application’s domain-specific object model, freeing you to work with data as objects while the framework manages the rest.

Ordering and filtering in LINQ queries by using built-in string functions inside your

LINQ queries

Aggregating data in LINQ queries

The end

top related