A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/system.data.linq.mapping.columnattribute.isdbgenerated below:

ColumnAttribute.IsDbGenerated Property (System.Data.Linq.Mapping) | Microsoft Learn

ColumnAttribute.IsDbGenerated Property Definition

Gets or sets whether a column contains values that the database auto-generates.

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

Default = false.

Examples
[Column(Storage="_OrderID", AutoSync=AutoSync.OnInsert, DbType="Int NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)]
public int OrderID
{
    get
    {
        return this._OrderID;
    }
    set
    {
        if ((this._OrderID != value))
        {
            this.OnOrderIDChanging(value);
            this.SendPropertyChanging();
            this._OrderID = value;
            this.SendPropertyChanged("OrderID");
            this.OnOrderIDChanged();
        }
    }
}
<Column(Storage:="_OrderID", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=true, IsDbGenerated:=true)>  _
Public Property OrderID() As Integer
    Get
        Return Me._OrderID
    End Get
    Set
        If ((Me._OrderID = value)  _
                    = false) Then
            Me.OnOrderIDChanging(value)
            Me.SendPropertyChanging
            Me._OrderID = value
            Me.SendPropertyChanged("OrderID")
            Me.OnOrderIDChanged
        End If
    End Set
End Property
Remarks

IsDbGenerated members are synchronized immediately after the row of data is inserted, and the members are available after SubmitChanges is completed.

Note

If the column holds primary key values and you designate IsDbGenerated as true, you should also add the DbType property by using the IDENTITY modifier.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4