Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DbModelBuilderVersionAttribute Class

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--also known as "Code First". See the DbModelBuilderVersion enumeration for details about DbModelBuilder versions.

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

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

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

NameDescription
System_CAPS_pubmethodDbModelBuilderVersionAttribute(DbModelBuilderVersion)

Initializes a new instance of the DbModelBuilderVersionAttribute class.

NameDescription
System_CAPS_pubpropertyTypeId

(Inherited from Attribute.)

System_CAPS_pubpropertyVersion

Gets the DbModelBuilder conventions version.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Attribute.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethodMatch(Object)

(Inherited from Attribute.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

If the attribute is missing from DbContextthen DbContext will always use the latest version of the conventions. This is equivalent to using DbModelBuilderVersion.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.

Return to top
Show:
© 2015 Microsoft