NPoco icon indicating copy to clipboard operation
NPoco copied to clipboard

Is version column in Sql Server supposed to be populated after an update?

Open preiius opened this issue 1 year ago • 1 comments

I have a column like in your example:

    [VersionColumn("Version", VersionColumnType.RowVersion)]
    public byte[] Version { get; set; }

After an update, I have to read poco to get new version, otherwise I get 'System.Data.DBConcurrencyException' exception on subsequent update.

Correct me if I'm wrong, according to following line, are you updating version property after update but for VersionColumnType.Number only?

https://github.com/schotime/NPoco/blob/4ededa1326c21632f8ce3d7d26dcd6cede7b386c/src/NPoco/Database.cs#L1357

preiius avatar Apr 29 '24 10:04 preiius

Thats correct. Happy to take PRs.

schotime avatar Nov 19 '24 02:11 schotime