ColumnAttribute.IsDiscriminator 属性

定义

获取或设置列是否包含 LINQ to SQL 继承层次结构的鉴别器值。

public:
 property bool IsDiscriminator { bool get(); void set(bool value); };
public bool IsDiscriminator { get; set; }
member this.IsDiscriminator : bool with get, set
Public Property IsDiscriminator As Boolean

属性值

默认值 = false

示例

[Column(Storage="_Title", DbType="NVarChar(30)",IsDiscriminator=true)]
public string Title
{
    get
    {
        return this._Title;
    }
    set
    {
        if ((this._Title != value))
        {
            this.OnTitleChanging(value);
            this.SendPropertyChanging();
            this._Title = value;
            this.SendPropertyChanged("Title");
            this.OnTitleChanged();
        }
    }
}
   <Column(Storage:="_Title", DbType:="NVarChar(30)", IsDiscriminator:=True)> _
Public Property Title() As String
       Get
           Return Me._Title
       End Get
       Set(ByVal value As String)
           If ((Me._Title = Value) _
              = False) Then
               Me.OnTitleChanging(Value)
               Me.SendPropertyChanging()
               Me._Title = Value
               Me.SendPropertyChanged("Title")
               Me.OnTitleChanged()
           End If
       End Set
   End Property

注解

当 为 时 true,此属性将类成员标识为持有继承层次结构的鉴别器值。

对于不超过一个成员,可以将此属性 true 设置为 ,该成员必须属于层次结构中最顶层的映射类。

适用于