ulong converted to long raises OverflowException
@corranrogue9 is already working on this.
Since May 17, 2022.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
Assemblies affected
Microsoft.AspNetCore.OData v.8.0.10
Microsoft.OData.Core v7.11.0
Describe the bug
Instead of representing row version with a byte array, I want to use a ulong (https://docs.microsoft.com/en-us/ef/core/modeling/value-conversions?tabs=data-annotations#use-ulong-for-timestamprowversion).
By default, ulong is converted to long and any value greater than long.MaxValue causes an OverflowException.
Reproduce steps
I've created a repo that contains an example (commented out) and a workaround: https://github.com/andygjp/ODataCustomUnsignedIntVersion/tree/main
Expected behavior
Instead of converting ulong to long, it should use another type, either custom or existing (decimal perhaps), avoiding OverflowExceptions and allowing me to do away with my custom conversion.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.