private Dictionary <int, int> GetTablesInDictionary() { var proxy = new RestaurantServiceClient(); var call = proxy.GetAllTablesByRestaurantAsync(Convert.ToInt32(HiddenResId.Content.ToString())); var tables = call.Result.ToList(); var dictionary = new Dictionary <int, int>(); foreach (var table in tables) { if (dictionary.ContainsKey(table.NoSeats)) { dictionary[table.NoSeats]++; } else { dictionary.Add(table.NoSeats, 1); } } return(dictionary); }