namespace FNZCM.BlazorWasm.Helpers { 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 T[] KeepNoEmpty(this T[] source) { if (false == (source?.Length > 0)) return new T[1]; return source; } } }