ColumnAttribute.IsDiscriminator Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Samarbeta med oss på GitHub
Källan för det här innehållet finns på GitHub, där du även kan skapa och granska ärenden och pull-begäranden. Se vår deltagarguide för mer information.