Download - The Object Relational Designer

Transcript
Page 1: The Object Relational Designer

The Object Relational Designer

Page 2: 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.

Page 3: The Object Relational Designer
Page 4: The Object Relational Designer
Page 5: The Object Relational Designer
Page 6: The Object Relational Designer

Connecting the DataContext to the Database

Page 7: The Object Relational Designer
Page 8: The Object Relational Designer
Page 9: The Object Relational Designer
Page 10: The Object Relational Designer
Page 11: The Object Relational Designer

Adding an Entity Class

Page 12: The Object Relational Designer
Page 13: The Object Relational Designer
Page 14: The Object Relational Designer

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.

Page 15: The Object Relational Designer

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

Page 16: The Object Relational Designer
Page 17: The Object Relational Designer
Page 18: The Object Relational Designer
Page 19: The Object Relational Designer

We will Add Insert Store Procedure

Page 20: The Object Relational Designer
Page 21: The Object Relational Designer
Page 22: The Object Relational Designer
Page 23: The Object Relational Designer
Page 24: The Object Relational Designer
Page 25: The Object Relational Designer
Page 26: The Object Relational Designer
Page 27: The Object Relational Designer
Page 28: The Object Relational Designer
Page 29: The Object Relational Designer
Page 30: The Object Relational Designer
Page 31: The Object Relational Designer
Page 32: The Object Relational Designer

Use SQLMetal and the O/R Designer Together

Page 33: The Object Relational Designer

• 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.

Page 34: The Object Relational Designer

Part-2

Page 35: The Object Relational Designer

• 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.

Page 36: The Object Relational Designer
Page 37: The Object Relational Designer
Page 38: The Object Relational Designer
Page 39: The Object Relational Designer
Page 40: The Object Relational Designer
Page 41: The Object Relational Designer
Page 42: The Object Relational Designer
Page 43: The Object Relational Designer
Page 44: The Object Relational Designer
Page 45: The Object Relational Designer
Page 46: The Object Relational Designer
Page 47: The Object Relational Designer

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

LINQ queries

Page 48: The Object Relational Designer
Page 49: The Object Relational Designer

Aggregating data in LINQ queries

Page 50: The Object Relational Designer
Page 51: The Object Relational Designer
Page 52: The Object Relational Designer

The end