public void AddDiceToCombination(CombinationsEnum type, List <Die> dice) { var combination = CombinationsList.First(c => c.Type == type); combination.Dice = dice; CalculateTotals(); }
public IActionResult AddCombination(CombinationsEnum type, List <Die> dice) { if (!_cache.TryGetValue(CacheKeys.Combinations, out Combinations combinations)) { combinations = new Combinations(); _cache.Set(CacheKeys.Combinations, combinations); } combinations.AddDiceToCombination(type, dice); _cache.Set(CacheKeys.Combinations, combinations); return(Ok()); }