UnintentionalCodeFirstException Class
Entity Framework 5.0
The exception that is thrown when a context is generated from the DbContext templates in Database First or Model First mode, and is then used in Code First mode.
System.Object
System.Exception
System.SystemException
System.InvalidOperationException
System.Data.Entity.Infrastructure.UnintentionalCodeFirstException
System.Exception
System.SystemException
System.InvalidOperationException
System.Data.Entity.Infrastructure.UnintentionalCodeFirstException
Namespace: System.Data.Entity.Infrastructure
Assembly: EntityFramework (in EntityFramework.dll)
The UnintentionalCodeFirstException type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | UnintentionalCodeFirstException | Initializes a new instance of the UnintentionalCodeFirstException class. |
![]() | UnintentionalCodeFirstException(String) | Initializes a new instance of the UnintentionalCodeFirstException class. |
![]() | UnintentionalCodeFirstException(SerializationInfo, StreamingContext) | Initializes a new instance of the UnintentionalCodeFirstException class. |
![]() | UnintentionalCodeFirstException(String, Exception) | Initializes a new instance of the UnintentionalCodeFirstException class. |
| Name | Description | |
|---|---|---|
![]() | Data | (Inherited from Exception.) |
![]() | HelpLink | (Inherited from Exception.) |
![]() | HResult | (Inherited from Exception.) |
![]() | InnerException | (Inherited from Exception.) |
![]() | Message | (Inherited from Exception.) |
![]() | Source | (Inherited from Exception.) |
![]() | StackTrace | (Inherited from Exception.) |
![]() | TargetSite | (Inherited from Exception.) |
| Name | Description | |
|---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetBaseException | (Inherited from Exception.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetObjectData | Security Critical. (Inherited from Exception.) |
![]() | GetType | (Inherited from Exception.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | ToString | (Inherited from Exception.) |
Code generated using the T4 templates provided for Database First and Model First use, may not work correctly if used in Code First mode. To use these classes with Code First add any additional configuration using attributes or by using DbModelBuilder and then remove the code that throws this exception.
Show:

