© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•6mo ago
Yarden

✅ I need help with explanation of given entity attributes

Updated the post

I've got recommended to add 3 attributes to my Entity:
        [Timestamp]
        public byte[] RowVersion { get; set; }
        public DateTime CreatedAtUtc { get; set; }
        public DateTime ModifiedAtUtc { get; set; }
        [Timestamp]
        public byte[] RowVersion { get; set; }
        public DateTime CreatedAtUtc { get; set; }
        public DateTime ModifiedAtUtc { get; set; }
cs


This is my current Entity class:
[Index(nameof(UserName), IsUnique = true)]
[Index(nameof(Email), IsUnique = true)]
public class UserEntity
{

    [Timestamp]
    public byte[] RowVersion { get; set; }
    public DateTime CreatedAtUtc { get; set; }
    public DateTime ModifiedAtUtc { get; set; }

    [Key] public int Id { get; set; }

    [Required, MaxLength(30)]
    [RegularExpression ("^[a-zA-Z0-9]+$")]                                                              //User name should not contain special characters
    public string UserName { get; set; } = default!;

    [Required, MaxLength(254), EmailAddress]
    public string Email { get; set; } = default!;

    ... More  attribut...
[Index(nameof(UserName), IsUnique = true)]
[Index(nameof(Email), IsUnique = true)]
public class UserEntity
{

    [Timestamp]
    public byte[] RowVersion { get; set; }
    public DateTime CreatedAtUtc { get; set; }
    public DateTime ModifiedAtUtc { get; set; }

    [Key] public int Id { get; set; }

    [Required, MaxLength(30)]
    [RegularExpression ("^[a-zA-Z0-9]+$")]                                                              //User name should not contain special characters
    public string UserName { get; set; } = default!;

    [Required, MaxLength(254), EmailAddress]
    public string Email { get; set; } = default!;

    ... More  attribut...
cs

What is the problem?
I guess I understood the purpose of CreatedAtUtc and ModifiedAtUtc.
But RowVersion I still don't understand.
I don't understand what exactly the purpose and how I suppose to manage this.
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Help new to c# and need explanation with substring
C#CC# / help
16mo ago
i need a bit of help with c#
C#CC# / help
3y ago
I need help with fourms
C#CC# / help
2y ago
I need help with ViewModel
C#CC# / help
3y ago