private static IEnumerable<TypeReference> BuildIFaces(TypeDefinition type, IDictionary<string, TypeReference> genericArgsMap)
{
var mappedFromSuperType = new List<TypeReference>();
foreach (var iface in type.Interfaces)
{
var result = iface;
if (iface is GenericInstanceType)
{
var map = GetGenericArgsMap(iface, genericArgsMap, mappedFromSuperType);
if (mappedFromSuperType.Any())
{
result = ((GenericInstanceType)iface).ElementType.MakeGenericInstanceType(map.Select(x => x.Value).ToArray());
}
}
yield return result;
}
}