Closed nealculiner closed 2 years ago
Adding the .ValueGeneratedOnAddOrUpdate(); resolved my issue. I'd offer this is a critical/blocker issue
Thanks Neal, I'll get this added.
Any timeline when we'll get an update for this? I really need this fixed ASAP please. I believe this affects RowVersion column types too.
I think the generator is missing the .IsRowVersion() method on this column type when it's set to required.
Hi @nealculiner Looking into now.
Got it sorted @nealculiner. Thanks for your patience.
Grab the latest code from EF.Reverse.POCO.v3.ttinclude and replace your project file with it.
Any problems, give me a shout.
Thank you
@sjh37 did you commit your changes as I don't see anything different yet?
Sorry my bad, It's on the development
branch.
Here it is development/EF.Reverse.POCO.v3.ttinclude
Now released in 3.6.1
I'm trying to add a new entity in EF Core 5 and I'm getting an error due to a column that has a time stamp data type (nullable). The error returned is:
I think what's missing in the generator for a timestamp column per a google search on this error is it possibly needs:
.ValueGeneratedOnAddOrUpdate();
Before:
builder.Property(x => x.ts).HasColumnName(@"ts").HasColumnType("timestamp").IsRequired(false);
After:
builder.Property(x => x.ts).HasColumnName(@"ts").HasColumnType("timestamp").IsRequired(false).ValueGeneratedOnAddOrUpdate();
https://entityframeworkcore.com/knowledge-base/45825877/inserting-record-in-sql-table-with-timestamp-datatype