30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
namespace BrokerApiCore;
|
|
|
|
public class SsoAccountDbContext: DbContext
|
|
{
|
|
private readonly DbContextOptions<SsoAccountDbContext> m_options;
|
|
public DbSet<SsoAccountInfo> SsoAccounts { get; set; }
|
|
// public DbSet<WalletUser> WalletUsers { get; set; }
|
|
|
|
public SsoAccountDbContext(DbContextOptions<SsoAccountDbContext> options) : base(options)
|
|
{
|
|
m_options = options;
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
modelBuilder.Entity<SsoAccountInfo>(entity =>
|
|
{
|
|
entity.ToTable("wallet_user");
|
|
entity.HasNoKey();
|
|
entity.Property(x => x.Id).HasColumnName("id").HasColumnType("bigint unsigned");
|
|
entity.Property(x => x.AccessToken).HasColumnName("access_token").HasColumnType("bigint unsigned");
|
|
entity.Property(x => x.AccessTokenIgm).HasColumnName("access_igm_token").HasColumnType("bigint unsigned");
|
|
entity.Property(x => x.Email).HasColumnName("email").HasColumnType("varchar(500)");
|
|
});
|
|
// base.OnModelCreating(modelBuilder);
|
|
}
|
|
}
|