Use EF Core Fluent API

This commit is contained in:
Jonathan
2022-07-01 17:05:45 +02:00
parent 245279a081
commit edc92b6d5b
4 changed files with 2 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ public class ApplicationDbContext : IdentityDbContext
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<FidoStoredCredential>().HasKey(m => m.Id);
builder.Entity<FidoStoredCredential>().Property(b => b.Id).ValueGeneratedOnAdd();
base.OnModelCreating(builder);
}

View File

@@ -12,7 +12,6 @@ public class FidoStoredCredential
/// <summary>
/// Gets or sets the primary key for this user.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public virtual int Id { get; set; }
/// <summary>

View File

@@ -16,6 +16,7 @@ public class ApplicationDbContext : IdentityDbContext
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<FidoStoredCredential>().HasKey(m => m.Id);
builder.Entity<FidoStoredCredential>().Property(b => b.Id).ValueGeneratedOnAdd();
base.OnModelCreating(builder);
}

View File

@@ -12,7 +12,6 @@ public class FidoStoredCredential
/// <summary>
/// Gets or sets the primary key for this user.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public virtual int Id { get; set; }
/// <summary>