Skip to content
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

IsRowVersion or [Timestamp] on property that maps to provider byte[] type should generate rowversion column #12434

Closed
ajcvickers opened this issue Jun 20, 2018 · 1 comment · Fixed by #29961
Labels
area-type-mapping closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. providers-beware type-enhancement
Milestone

Comments

@ajcvickers
Copy link
Contributor

As described in #5936, mapping a ulong with a store type of "rowversion" (or "timestamp") results in a rowversion column in SQL Server that can be used effectively in LINQ queries. This should also work for cases like this:

public class Blog
{
    public int Id { get; set; }
    public ulong RowVersion { get; set; }
}

modelBuilder
    .Entity<Blog>()
    .Property(e => e.RowVersion)
    .HasConversion<byte[]>()
    .IsRowVersion();

and this:

public class Blog
{
    public int Id { get; set; }

    [Timestamp]
    public ulong RowVersion { get; set; }
}

modelBuilder
    .Entity<Blog>()
    .Property(e => e.RowVersion)
    .HasConversion<byte[]>();

And possibly even when .HasConversion<byte[]>() is not used explicitly, since IsRowVersion or [Timestamp] imply this, at least for SQL Server

@AndriySvyryd
Copy link
Member

Related: #12436

ajcvickers added a commit that referenced this issue Jan 1, 2023
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jan 1, 2023
@ajcvickers ajcvickers modified the milestones: Backlog, 8.0.0 Jan 1, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-preview1 Jan 29, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-preview1, 8.0.0 Nov 14, 2023
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-type-mapping closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. providers-beware type-enhancement
Projects
None yet
2 participants