Redigera

Dela via


ColumnAttribute.IsDiscriminator Property

Definition

Gets or sets whether a column contains a discriminator value for a LINQ to SQL inheritance hierarchy.

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

Property Value

Default = false.

Examples

[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

Remarks

When true, this property identifies the class member as holding the discriminator value for an inheritance hierarchy.

You can set this property to true for no more than one member, which must belong to the topmost mapped class in the hierarchy.

Applies to