![]() ![]() Renaming a Foreign Key That Is Not Defined in the Model The following example maps the Name CLR property to the DepartmentName database column. Mapping a CLR Property to a Specific Column in the Database modelBuilder.Entity().Ignore(t => t.Budget) The following example shows how to specify that a property on a CLR type is not mapped to a column in the database. Specifying Not to Map a CLR Property to a Column in the Database The following example configures the DepartmentID and Name properties to be the composite primary key of the Department type. modelBuilder.Entity().HasKey(t => t.InstructorID) In the following example, the HasKey method is used to configure the InstructorID primary key on the OfficeAssignment type. To explicitly set a property to be a primary key, you can use the HasKey method.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |