-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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());
}
_implementations.Add should be wrapped in an else
Metadata
Metadata
Assignees
Labels
No labels