Translation and collation of EF 4.1 MSDN conventions

Source: Internet
Author: User

Original http://blog.csdn.net/aofengdaxia/article/details/7024958

MSDN class library address: http://msdn.microsoft.com/en-us/library/gg696316 (v = VS.103 ). aspx is helpless in English, so I will make a brief translation of common conventions to help students who are not very good in E to learn and understand them. Due to level issues, errors are inevitable and I look forward to your correction.

Name Function Simple understanding
AssociationInverseDiscoveryConvention Search for the attributes of the classes referenced in the navigation and configure them as the same relationship of the inverse attributes.  
ColumnAttributeConvention Processing the Colum attribute in the object class (Model) at runtime  
ColumnTypeCasingConvention Conventions that specify strict data types through annotations or DbModelBuilder APIs  
ComplexTypeAttributeConvention Handle complex types of conventions found during operation  
ComplexTypeDiscoveryConvention Find the types with or without primary keys and configure them as complex types.  
ConcurrencyCheckAttributeConvention Convention for processing the concurrencycheckattri attribute in the Model  
DatabaseGeneratedAttributeConvention Convention for processing DatabaseGeneratedAttribute attributes in the Model  
DecimalPropertyConvention Convention to adjust decimal precision to decimal's last two digits  
DeclaredPropertyOrderingConvention Move the primary key to appear first  
ForeignKeyAssociationMultiplicityConvention Distinguishes the relationship between the primary key and the foreign key based on whether the CLR Runtime is null  
ForeignKeyNavigationPropertyAttributeConvention Convention for processing the navigation attributes of ForeignKeyAttribute when running the Model  
ForeignKeyPrimitivePropertyAttributeConvention Convention for processing the attributes of the ForeignKeyAttribute primary key when running the Model  
IdKeyDiscoveryConvention Conventions for detecting primary keys by Id  
InversePropertyAttributeConvention Convention for processing InversePropertyAttribute in model attributes  
KeyAttributeConvention Conventions for processing KeyAttribute in Models  
ManyToManyCascadeDeleteConvention Convention for adding cascade intermediate tables to multiple-to-multiple relationships  
MappingInheritedPropertiesSupportConvention Make sure that the property inherited by the ing does not create an invalid or unsupported ing.  
MaxLengthAttributeConvention Process MaxLengthAttribute attributes when running the Model  
NavigationPropertyNameForeignKeyDiscoveryConvention To process the relationship between the navigation property and the foreign key property, you must add the s key to the navigation property.  
NotMappedPropertyAttributeConvention Processing NotMappedAttribute on Attributes  
NotMappedTypeAttributeConvention Processing attribute NotMappedAttribute on Type  
OneToManyCascadeDeleteConvention Process one-to-multiple row-level deletion relationships  
OneToOneConstraintIntroductionConvention Set the primary key of the dependency to a foreign key to meet the one-to-one relationship.  
PluralizingEntitySetNameConvention Set the object set name to a diverse entity type name version.  
PluralizingTableNameConvention The name of the table is a diverse entity type name version.  
PrimaryKeyNameForeignKeyDiscoveryConvention Match foreign key names with primary keys  
PropertyMaxLengthConvention The default maximum length in terms of length.  
RequiredNavigationPropertyAttributeConvention Process RequiredAttribute in model attributes  
RequiredPrimitivePropertyAttributeConvention Process RequiredAttribute in model attributes  
SqlCePropertyMaxLengthConvention When SQLCE supports this function, set 4000 to the default maximum length.  
StoreGeneratedIdentityKeyConvention Set auto-increment ID to primary key  
StringLengthAttributeConvention Processing StringLengthAttribute found in model attributes  
TableAttributeConvention TableAttribute attribute found in Processing Model  
TimestampAttributeConvention Process the TimestampAttribute attribute  

TypeNameForeignKeyDiscoveryConvention conventions on primary key attributes and foreign key attributes with S

 

 

The above is a rough translation of the EF 4.1 Convention, because there are some EF conventions, and during use, it is often necessary to delete some conventions to avoid receiving restrictions.

As follows:

[Csharp]View plaincopyprint?
  1. ModelBuilder. conventions. remove <PluralizingTableNameConvention> (); // Remove the contract modelBuilder with the complex table name. conventions. remove <shortdemetadataconvention> (); // prevents black-screen transactions. Otherwise, you must access the EdmMetadata table every time.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.