Ejemplo n.º 1
0
 public HomeController(ILogger <HomeController> logger, IMemoryCache cache, Rps_Game game)
 {
     _logger = logger;
     _cache  = cache;
     _game   = game;
     //if the _cache doesn't have a players list, create one.
     if (!_cache.TryGetValue("players", out players))
     {
         _cache.Set("players", new List <Player>());
         _cache.TryGetValue("players", out players);
         _cache.TryGetValue("games", out games);
         _cache.TryGetValue("rounds", out rounds);
     }
 }
 public RpsController(ILogger <RpsController> logger, IMemoryCache cache, Rps_Game game)
 {
     _logger = logger;
     _cache  = cache;
     _game   = game;
 }