Adds the implementation even if it is already inside the dictionary throwing an error:
if (type.IsGenericTypeDefinition)
{
var implementations = GetGenericImplementationsOf(assembly, type);
if (implementations != null && implementations.Length > 0)
{
// We have some generic implementations, however, we may need to remove
// some duplicates where implementations have been added by default
if (_implementations.TryGetValue(type, out var current))
{
// We have some already added... lets remove duplicates!
var newItems = implementations
.ToList()
.Where(a => !current.Contains(a))
.ToArray();
// Add to implementations
_implementations[type].AddRange(newItems);
}
_implementations.Add(type, implementations.ToList());
}
Line 53 of https://github.com/AetherFlowDev/PluginFramework/blob/v1/develop/AetherFlow.Framework/DataverseContainer.cs
Adds the implementation even if it is already inside the dictionary throwing an error:
_implementations.Add should be wrapped in an else