Skip to content

Commit

Permalink
Merge pull request #43 from vanillajonathan/use-fluent-api
Browse files Browse the repository at this point in the history
Use EF Core Fluent API
  • Loading branch information
damienbod authored Nov 10, 2023
2 parents 68d4383 + edc92b6 commit a601185
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions AspNetCoreIdentityFido2Mfa/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<FidoStoredCredential>().HasKey(m => m.Id);
builder.Entity<FidoStoredCredential>().Property(b => b.Id).ValueGeneratedOnAdd();

base.OnModelCreating(builder);
}
Expand Down
1 change: 0 additions & 1 deletion AspNetCoreIdentityFido2Mfa/Fido2/FidoStoredCredential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<FidoStoredCredential>().HasKey(m => m.Id);
builder.Entity<FidoStoredCredential>().Property(b => b.Id).ValueGeneratedOnAdd();

base.OnModelCreating(builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit a601185

Please sign in to comment.