DbModelBuilderVersionAttribute Class

This attribute can be applied to a class derived from DbContext to set which version of the DbContext and DbModelBuilder conventions should be used when building a model from code. See the DbModelBuilderVersion enumeration for details about DbModelBuilder versions.


Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)]
public sealed class DbModelBuilderVersionAttribute : Attribute

The DbModelBuilderVersionAttribute type exposes the following members.

Public methodDbModelBuilderVersionAttributeInitializes a new instance of the DbModelBuilderVersionAttribute class.

Public propertyTypeId (Inherited from Attribute.)
Public propertyVersionGets the DbModelBuilder conventions version.

Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)

If the attribute is missing from DbContext then DbContext will always use the latest version of the conventions. This is equivalent to using Latest.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.