PostgreSql Serial/Auto-increment PK

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
Posts: 79
Joined: Tue 02 Jun 2015 18:22

PostgreSql Serial/Auto-increment PK

Post by OutOfTouch6947 » Thu 11 Jun 2015 18:05

How does Entity Developer handle inserting versus editing rows where the primary key is Serial?
Also when inserting is there a way to get the ID back?

Here is what I mean.

Code: Select all

  [Column(Name = @"scorecard_id", Storage = "_ScorecardId", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "SERIAL NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
        [System.ComponentModel.DataAnnotations.Required(ErrorMessage = @"Value is required.")]
        public int ScorecardId
                return this._ScorecardId;
                if (this._ScorecardId != value)
                    this._ScorecardId = value;

Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: PostgreSql Serial/Auto-increment PK

Post by MariiaI » Fri 12 Jun 2015 13:23

We are sending you a small test project to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter.
Some useful information is available here: ... ation.html ... gData.html ... hecks.html

Also, you can check the generated SQL queries via LinqMonitor or Log property of your DataContext object. For more information please refer to

If you have any further questions, feel free to contact us.

Post Reply