© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
Eple

❔ How to make property auto-increment?

I have set the following attributes on
LocalId
LocalId
property, but still it does not have auto-increment enabled in SQLite table
public class ApplicationUser : IdentityUser
{
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    [Key]
    public int LocalId { get; set; }
    public string? FirstName { get; set; }
    public string? LastName { get; set; }

}
public class ApplicationUser : IdentityUser
{
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    [Key]
    public int LocalId { get; set; }
    public string? FirstName { get; set; }
    public string? LastName { get; set; }

}
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

how to make id of model as auto increment
C#CC# / help
2y ago
Why am I unable to increment this property?
C#CC# / help
2y ago
How to make this Field into Property
C#CC# / help
2y ago