35 lines
948 B
C#
35 lines
948 B
C#
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Sequence.Entities;
|
|
|
|
public class DbContext : IdentityDbContext<User, IdentityRole<Guid>, Guid>
|
|
{
|
|
public DbContext(DbContextOptions<DbContext> options) : base(options) { }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
var deck = CardUtility.GenerateDeck();
|
|
|
|
var players = new Player[]
|
|
{
|
|
new Player
|
|
{
|
|
Id = Guid.NewGuid(),
|
|
|
|
}
|
|
};
|
|
|
|
modelBuilder.Entity<Card>().HasData(deck);
|
|
|
|
//modelBuilder.Entity<Player>().HasData()
|
|
}
|
|
|
|
public DbSet<Card> Cards { get; set; }
|
|
public DbSet<PlayerCard> PlayerCards { get; set; }
|
|
public DbSet<Match> Matches { get; set; }
|
|
public DbSet<Player> Players { get; set; }
|
|
|
|
} |