static public CustomAttribute AddCustomAttributeOfType(this MethodDefinition item, TypeReference type) { return(item.AddCustomAttributeWithConstructor( item.GetModuleDefinition().Import(type.Resolve().GetConstructor()) )); }