getting closer...
This commit is contained in:
parent
495d6182a4
commit
fea4785655
23
DbContext.cs
23
DbContext.cs
@ -11,20 +11,21 @@ public class DbContext : IdentityDbContext<User, IdentityRole<Guid>, Guid>
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
var deck = CardUtility.GenerateDeck();
|
||||
//return;
|
||||
|
||||
var players = new Player[]
|
||||
{
|
||||
new Player
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
|
||||
}
|
||||
};
|
||||
// generate two source decks
|
||||
var deck1 = CardUtility.GenerateCards();
|
||||
var deck2 = CardUtility.GenerateCards();
|
||||
|
||||
modelBuilder.Entity<Card>().HasData(deck);
|
||||
var cards = deck1.Concat(deck2);
|
||||
|
||||
//modelBuilder.Entity<Player>().HasData()
|
||||
|
||||
|
||||
modelBuilder.Entity<Card>().HasData(cards);
|
||||
modelBuilder.Entity<Player>().HasData(players);
|
||||
modelBuilder.Entity<Match>().HasData(match);
|
||||
modelBuilder.Entity<DeckCard>().HasData(deck);
|
||||
modelBuilder.Entity<HandCard>().HasData(handCards);
|
||||
}
|
||||
|
||||
public DbSet<Card> Cards { get; set; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user