namespace FNZCM.BlazorWasm.Utility { public static class ExtenstionMetohd { public static IEnumerable<(T item, int index)> WithIndex(this IEnumerable self) => self.Select((item, index) => (item, index)); public static TV GetEx(this IDictionary dic, TK key) { if (key == null) return default; return dic.TryGetValue(key, out var tv) ? tv : default; } public static IReadOnlyCollection KeepNoEmpty(this IReadOnlyCollection source) { if (source == null) return new T[1]; if (source.Count == 0) return new T[1]; return source; } } }