public void Post(string name) { _context.Players.Add(new Player() { Name = name }); _context.SaveChanges(); }
public void Post(int cardId, int handId) { Card c = new Card() { CardId = cardId, HandId = handId }; _context.Cards.Add(c); _context.SaveChanges(); }
public void Post(int playerId, [FromBody] Hand hand) { hand.PlayerId = playerId; _context.Hands.Add(hand); foreach (Card c in hand.Cards) { c.HandId = hand.Id; _context.Cards.Add(c); } _context.SaveChanges(); }