Beispiel #1
0
        public List <GetUserSpectetorsGameResult> GetUserSpectetorsGameResult(int userId)
        {
            List <GetUserSpectetorsGameResult> toReturn = new List <GetUserSpectetorsGameResult>();

            try
            {
                using (var db = new connectionsLinqDataContext())
                {
                    toReturn = db.GetUserSpectetorsGame(userId).ToList();
                    return(toReturn);
                }
            }
            catch (Exception)
            {
                return(toReturn);
            }
        }
Beispiel #2
0
 public bool HasThisSpectetorGame(int userId, int roomId, int gameId)
 {
     try
     {
         using (var db = new connectionsLinqDataContext())
         {
             var allUserGames = db.GetUserSpectetorsGame(userId);
             foreach (var entry in allUserGames)
             {
                 if (entry.Game_Id == gameId && entry.roomId == roomId)
                 {
                     return(true);
                 }
             }
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }