dotnet / EntityFramework.Docs

Documentation for Entity Framework Core and Entity Framework 6
https://docs.microsoft.com/ef/
Creative Commons Attribution 4.0 International
1.59k stars 1.95k forks source link

Numeric rowversions doesn't need a HasConversion call #4725

Open cremor opened 1 month ago

cremor commented 1 month ago

Type of issue

Missing information

Description

The section Numeric rowversions for SQL Azure/SQL Server is written in a way that implies that the call to HasConversion<byte[]>() is required to get this new feature to work.

But from my tests it looks like this works automatically when you have an ulong property with the Timestamp attribute. I haven't tested it but I assume the same is true for fluent mapping via IsRowVersion().

So why does the documentation explicitly call HasConversion<byte[]>()? The difference isn't that important with fluent mapping, but in the case of attribute mapping it's very important since there is no way to specify HasConversion<byte[]>() as an attribute.

Page URL

https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew#numeric-rowversions-for-sql-azuresql-server

Content source URL

https://github.com/dotnet/EntityFramework.Docs/blob/main/entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md

Document Version Independent Id

97203c5d-fe52-b71e-dcb3-71c9492b4e04

Article author

@ajcvickers

roji commented 1 month ago

Thanks, submitted #4727 to fix. Note that it's generally very easy to just open a PR suggesting a small change rather than describe it in an issue etc.