-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse engineering rowversion/timestamp on SQL Server should generate ulong property #12435
Comments
There appears to be a bug in the way RowVersion/Timestamp fields are converted from I have two models, both of which have Timestamp properties: public class First
{
public Guid ID { get; set; }
public ulong Timestamp { get; set; }
}
public class Second
{
public Guid Id { get; set; }
public ulong Timestamp { get; set; }
public Guid? OtherID { get; set; }
public First Other { get; set; }
} that are mapped as RowVersion fields: protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<First>()
.Property(e => e.Timestamp)
.HasColumnType(“RowVersion”)
.IsRowVersion();
modelBuilder.Entity<Second>()
.Property(e => e.Timestamp)
.HasColumnType(“RowVersion”)
.IsRowVersion();
} Note that If I run the following query: dbContext.Seconds.Include(s => Other).ToList(); as long as the Because that's NULL, an exception is thrown from the
If I understand this correctly, the converter is not handling NULL values properly? |
@patrikrazem This looks like a duplicate of issue #12518 |
You're absolutely right, I must've missed that issue. |
Also recommend using |
Because mapping to ulong with conversion is a nicer experience that mapping to byte[]. See #5936
The text was updated successfully, but these errors were encountered: