C
C#2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
Shirasho
Shirasho2y ago
Identity does not imply auto increment. You need to manually specify it auto increments.
Accord
Accord2y 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.