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

DbConfigurationTypeAttribute Class

 

This attribute can be placed on a subclass of DbContext to indicate that the subclass of DbConfiguration representing the code-based configuration for the application is in a different assembly than the context type.

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

System.Object
  System.Attribute
    System.Data.Entity.DbConfigurationTypeAttribute

[SuppressMessageAttribute("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")]
[SuppressMessageAttribute("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")]
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)]
public class DbConfigurationTypeAttribute : Attribute

NameDescription
System_CAPS_pubmethodDbConfigurationTypeAttribute(String)

Indicates that the subclass of DbConfiguration represented by the given assembly-qualified name should be used for code-based configuration for this application.

System_CAPS_pubmethodDbConfigurationTypeAttribute(Type)

Indicates that the given subclass of DbConfiguration should be used for code-based configuration for this application.

NameDescription
System_CAPS_pubpropertyConfigurationType

Gets the subclass of DbConfiguration that should be used for code-based configuration for this application.

System_CAPS_pubpropertyTypeId

(Inherited from Attribute.)

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Attribute.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

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_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

Normally a subclass of DbConfiguration should be placed in the same assembly as the subclass of DbContext used by the application. It will then be discovered automatically. However, if this is not possible or if the application contains multiple context types in different assemblies, then this attribute can be used to direct DbConfiguration discovery to the appropriate type. An alternative to using this attribute is to specify the DbConfiguration type to use in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=260883 for more information.

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