public void CreatePlayer(Player player) { db.Players.Add(player); db.SaveChanges(); }
public void UpdatePlayer(Player player) { db.Entry(player).State = EntityState.Modified; db.SaveChanges(); }
private Player CreateExamplePlayer(int accountid, int playergroupid, string playername) { try { IPlayerRepository playerrep = new EntityPlayerRepository(); Player player = new Player(); player.AccountID = accountid; player.PlayerGroupID = playergroupid; player.PlayerName = playername; player.PlayerLocation = String.Empty; player.PlayerDescription = String.Empty; player.IsActive = true; playerrep.CreatePlayer(player); return player; } catch { return null; } }