C
C#3y ago
Eple

❔ How to make property auto-increment?

I have set the following attributes on 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; }

}
3 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Shirasho
Shirasho3y ago
Identity does not imply auto increment. You need to manually specify it auto increments.
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?