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
Met ons samenwerken op GitHub
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en controleren. Bekijk onze gids voor inzenders voor meer informatie.