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);
|
base.OnModelCreating(modelBuilder);
|
||||||
|
|
||||||
var deck = CardUtility.GenerateDeck();
|
//return;
|
||||||
|
|
||||||
var players = new Player[]
|
// generate two source decks
|
||||||
{
|
var deck1 = CardUtility.GenerateCards();
|
||||||
new Player
|
var deck2 = CardUtility.GenerateCards();
|
||||||
{
|
|
||||||
Id = Guid.NewGuid(),
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
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; }
|
public DbSet<Card> Cards { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user