Barefoot Learning
In the previous demonstration, whether it is about how to generate an external XML ing file, a dbml file, and verifying the two files, this includes the previous demo about how to serialize object class objects in the object model, which is a question about how to create an object model. However, in these demos, we focus on how to use tools to create object models, whether using sqlmetal or object relationship designer. The following demos will help you see how to use them.CodeEditor custom object model ......
UseDatabaseattributeYou can specify the name of a database when no name is provided for a connection.
You can apply the databaseattribute feature to any strong type.DatacontextStatement.
This information is used only when no database name is specified for the connection.
The databaseattribute feature is optional. If you use this feature, you must useNameAttribute to provide a name. If this feature is not applied and the connection name is not specified, it is assumed that the database has the same name as the datacontext class.
Sample Code
[Database (name = "northwind")] public partial class northwinddatacontext: system. Data. LINQ. datacontext {}