using System; using System.Collections.Generic; namespace DhcpServer.Utils { internal static class ExtensionMethods { public static TR MapValue(this Dictionary dic, TK key, Func found) { return dic.TryGetValue(key, out var value) ? found(value) : default; } public static TR MapValue(this Dictionary dic, TK key, Func found, Func notFound) { return dic.TryGetValue(key, out var value) ? found(value) : notFound(); } } }