Export (0) Print
Expand All

DbModelBuilderVersionAttribute Class

Entity Framework 5.0

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.

System.Object
  System.Attribute
    System.Data.Entity.DbModelBuilderVersionAttribute

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.

  NameDescription
Public methodDbModelBuilderVersionAttributeInitializes a new instance of the DbModelBuilderVersionAttribute class.
Top

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

  NameDescription
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.)
Top

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.
Show:
© 2014 Microsoft