Optimize admin user list

This commit is contained in:
Kukks
2021-11-15 10:27:19 +01:00
parent 56c8e43ce8
commit 31cf2671f5
5 changed files with 21 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
namespace BTCPayServer.Data
{
@@ -18,5 +19,14 @@ namespace BTCPayServer.Data
public List<NotificationData> Notifications { get; set; }
public List<UserStore> UserStores { get; set; }
public List<Fido2Credential> Fido2Credentials { get; set; }
public List<IdentityUserRole<string>> UserRoles { get; set; }
public static void OnModelCreating(ModelBuilder builder)
{
builder.Entity<ApplicationUser>()
.HasMany<IdentityUserRole<string>>(user => user.UserRoles)
.WithOne().HasForeignKey(role => role.UserId);
}
}
}