ColumnAttribute.IsDiscriminator Property

 

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

Namespace:   System.Data.Linq.Mapping
Assembly:  System.Data.Linq (in System.Data.Linq.dll)

public bool IsDiscriminator { get; set; }

Property Value

Type: System.Boolean

Default = false.

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.

[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();
		}
	}
}

.NET Framework
Available since 3.5
Windows Phone Silverlight
Available since 7.1
Return to top
Show: