コード例 #1
0
 //void or bool
 public bool AddGameInformation(int _Game_id, GameInformation _list)
 {
     var query = from g in context.MyGames where g.GameId == _Game_id select g;
     Game found_game = null;
     bool result = true;
     try
     {
         found_game = query.Single<Game>();
         found_game.GamesPlayed.Add(_list);
         context.SaveChanges();
     }
     catch (InvalidOperationException)
     {
         result = false;
     }
     catch (ArgumentNullException)
     {
         result = false;
     }
     return result;
 }
コード例 #2
0
 public void GameInformationEnsurePropertiesWork()
 {
     GameInformation newgame = new GameInformation { ScoreHoleOne = 3 };
 }
コード例 #3
0
 public void GameInformationEnsureICanCreateInstance()
 {
     GameInformation newgame = new GameInformation();
     Assert.IsNotNull(newgame);
 }