Mono.Cecil.Fluent.CecilExtensions.MakeGeneric C# (CSharp) Method

MakeGeneric() public static method

public static MakeGeneric ( this self ) : TypeReference
self this
return TypeReference
        public static TypeReference MakeGeneric(this TypeReference self, params TypeReference[] arguments)
        {
            if (self.GenericParameters.Count != arguments.Length)
                throw new ArgumentException($"generic parameters count of type {self.Name} does not match given number of types");

            var instance = new GenericInstanceType(self);
            foreach (var argument in arguments)
                instance.GenericArguments.Add(argument);

            return instance;
        }
	}