Constructor injection
class PerServiceSettings : Dictionary<string, string>
{
public PerServiceSettings(Dictionary<string, string> dictionary)
: base(dictionary, StringComparer.OrdinalIgnoreCase)
{
}
}class PerServiceSettings
{
public PerServiceSettings(Dictionary<string, string> data)
{
Index = data;
InvertedIndex = Index.ToDictionary(
pair => pair.Value,
pair => pair.Key
);
}
public Dictionary<string, string> Index { get; }
public Dictionary<string, string> InvertedIndex { get; }
}Related pages
CollectionsLast updated
Was this helpful?