示例#1
0
 public void CreatePlayer(Player player)
 {
     db.Players.Add(player);
     db.SaveChanges();
 }
示例#2
0
 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; }
        }