Object Relational Designer (O/R Designer)
The Object Relational Designer (O/R Designer) provides a visual design surface for creating LINQ to SQL entity classes and associations (relationships) that are based on objects in a database. In other words, the O/R Designer is used to create an object model in an application that maps to objects in a database. It also generates a strongly-typed DataContext that is used to send and receive data between the entity classes and the database. The O/R Designer also provides functionality to map stored procedures and functions to DataContext methods for returning data and populating entity classes. Finally, the O/R Designer provides the ability to design inheritance relationships between entity classes.
Note
The O/R Designer currently supports only SQL Server 2000, SQL Server 2005, SQL Server 2008, and SQL Server Express databases. Although O/R Designer does not support SQL Server Compact 3.5, LINQ to SQL does. For more information, see SQL Server Compact 3.5 and LINQ to SQL. For information about obtaining SQL Server Express, see the Obtaining SQL Server Express section in the How to: Install Sample Databases topic.
In This Section
O/R Designer Overview
Explains what the O/R Designer is and provides information about the tasks you can accomplish with it.DataContext Methods (O/R Designer)
Explains what DataContext methods are and how to create them.Data Class Inheritance (O/R Designer)
Describes the concept of single-table inheritance and how it is implemented in the O/R Designer.How to: Add LINQ to SQL Classes to a Project (O/R Designer)
Describes how to add an empty LINQ to SQL file to a project.How to: Create LINQ to SQL Classes Mapped to Tables and Views (O/R Designer)
Describes how to create entity classes that are mapped to tables and views in a database.How to: Create an Association (Relationship) Between LINQ to SQL Classes (O/R Designer)
Describes how to create a relationship between LINQ to SQL entity classes.How to: Create DataContext Methods Mapped to Stored Procedures and Functions (O/R Designer)
Describes how to create DataContext methods that run stored procedures or functions when they are called.How to: Assign Stored Procedures to Perform Updates, Inserts, and Deletes (O/R Designer)
Describes how to configure a DataContext to use stored procedures when saving data from entity classes back to a database.How to: Change the Return Type of a DataContext Method (O/R Designer)
Describes how to set the return type of a DataContext method to be the type of an entity class or an auto-generated type created by the O/R Designer.How to: Add Validation to Entity Classes
Describes how to generate partial methods that enable the addition of code during property changes and entity class updates.How to: Turn Pluralization On and Off (O/R Designer)
Describes how to turn on and off the automatic renaming of classes that are added to the O/R Designer.How to: Configure Inheritance by Using the O/R Designer
Describes how to configure entity classes using single-table inheritance with the O/R Designer.How to: Extend Code Generated by the O/R Designer
Describes how and where to add code that will not be overwritten when changes to objects on the O/R Designer regenerate code.Walkthrough: Creating LINQ to SQL Classes (O/R Designer)
Provides step-by-step instructions for designing entity classes by using the O/R Designer and for displaying data on a Windows Form.Walkthrough: Creating LINQ to SQL Classes by Using Single-Table Inheritance (O/R Designer)
Provides step-by-step instructions for configuring entity classes using single-table inheritance with the O/R Designer.Walkthrough: Customizing the Insert, Update, and Delete Behavior of Entity Classes
Provides step-by-step instructions for configuring a DataContext to use stored procedures when saving data from entity classes back to a database.Walkthrough: Adding Validation to Entity Classes
Provides step-by-step instructions for generating empty partial methods for adding code that is called during property changes and entity class updates.
Reference
Related Sections
Frequently Asked Questions (LINQ to SQL)