Ejemplo n.º 1
0
 /// <summary>
 /// Convert a WCF Game object into a Game Entity object
 /// </summary>
 /// <param name="game"></param>
 /// <returns></returns>
 private Game WCFToGame(GameWcf game)
 {
     Game ret = new Game();
     ret.ID = game.ID;
     ret.IP = game.IP;
     ret.NumOfUsers = game.numOfPlayers;
     ret.FirstUser = game.FirstUser;
     ret.SecondUser = game.SecondUser;
     return ret;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// convert a Game Entity object to a WCF Game object
 /// </summary>
 /// <param name="game"></param>
 /// <returns></returns>
 private GameWcf gameToWCF(Game game){
     GameWcf ret = new GameWcf();
     ret.ID = game.ID;
     ret.IP = game.IP;
     ret.numOfPlayers = game.NumOfUsers;
     ret.FirstUser = game.FirstUser;
     ret.SecondUser = game.SecondUser;
     return ret;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new Game object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="iP">Initial value of the IP property.</param>
 /// <param name="firstUser">Initial value of the FirstUser property.</param>
 /// <param name="numOfUsers">Initial value of the NumOfUsers property.</param>
 public static Game CreateGame(global::System.Int32 id, global::System.String iP, global::System.String firstUser, global::System.Int32 numOfUsers)
 {
     Game game = new Game();
     game.ID = id;
     game.IP = iP;
     game.FirstUser = firstUser;
     game.NumOfUsers = numOfUsers;
     return game;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Remove a game from the DB
 /// </summary>
 /// <param name="game">Game to Remove</param>
 public void removeGame(Game game)
 {
     using (BlackJackDataEntities ctx = new BlackJackDataEntities())
     {
         ctx.Game.Attach(game);
         ctx.DeleteObject(game);
         ctx.SaveChanges();
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Game EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGame(Game game)
 {
     base.AddObject("Game", game);
 }