PropertyConstraintException 类

[本页针对的是实体框架版本 6。最新版本以“实体框架”NuGet 包的形式提供。有关实体框架的更多信息,请参见 msdn.com/data/ef。]

表示属性约束异常类。 请注意,此类具有状态 - 因此,即使您更改其内部,也可能是重大更改。

继承层次结构

System.Object
  System.Exception
    System.SystemException
      System.Data.DataException
        System.Data.ConstraintException
          System.Data.Entity.Core.PropertyConstraintException

命名空间:  System.Data.Entity.Core
程序集:  EntityFramework(在 EntityFramework.dll 中)

语法

声明
<SerializableAttribute> _
<SuppressMessageAttribute("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Justification := "SerializeObjectState used instead")> _
Public NotInheritable Class PropertyConstraintException _
    Inherits ConstraintException
用法
Dim instance As PropertyConstraintException
[SerializableAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Justification = "SerializeObjectState used instead")]
public sealed class PropertyConstraintException : ConstraintException
[SerializableAttribute]
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1032:ImplementStandardExceptionConstructors", Justification = L"SerializeObjectState used instead")]
public ref class PropertyConstraintException sealed : public ConstraintException
[<SealedAttribute>]
[<SerializableAttribute>]
[<SuppressMessageAttribute("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Justification = "SerializeObjectState used instead")>]
type PropertyConstraintException =  
    class 
        inherit ConstraintException 
    end
public final class PropertyConstraintException extends ConstraintException

PropertyConstraintException 类型公开以下成员。

构造函数

  名称 描述
公共方法 PropertyConstraintException() 初始化 PropertyConstraintException 类的新实例。
公共方法 PropertyConstraintException(String) 初始化 PropertyConstraintException 类的新实例。
公共方法 PropertyConstraintException(String, Exception) 使用提供的消息和内部异常初始化 PropertyConstraintException 类的新实例
公共方法 PropertyConstraintException(String, String) 初始化 PropertyConstraintException 类的新实例。
公共方法 PropertyConstraintException(String, String, Exception) 初始化 PropertyConstraintException 类的新实例。

顶部

属性

  名称 描述
公共属性 Data (继承自 Exception。)
公共属性 HelpLink (继承自 Exception。)
公共属性 HResult (继承自 Exception。)
公共属性 InnerException (继承自 Exception。)
公共属性 Message (继承自 Exception。)
公共属性 PropertyName 获取违反了约束的属性的名称。
公共属性 Source (继承自 Exception。)
公共属性 StackTrace (继承自 Exception。)
公共属性 TargetSite (继承自 Exception。)

顶部

方法

  名称 描述
公共方法 Equals (继承自 Object。)
公共方法 GetBaseException (继承自 Exception。)
公共方法 GetHashCode (继承自 Object。)
公共方法 GetObjectData 安全关键。 (继承自 Exception。)
公共方法 GetType (继承自 Exception。)
公共方法 ToString (继承自 Exception。)

顶部

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

System.Data.Entity.Core 命名空间