Ejemplo n.º 1
0
        public List <GetAllUserActiveGameResult> GetAllUserActiveGames(int userId)
        {
            List <GetAllUserActiveGameResult> toReturn = new List <GetAllUserActiveGameResult>();

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