using System; using System.Reflection; public interface IA { void Foo (IA self); } public static class C { public static TAttribute GetCustomAttribute (this ICustomAttributeProvider self) { var attributes = self.GetCustomAttributes (); // if (attributes == null || attributes.Length == 0) // return null; return attributes [0]; } public static TAttribute [] GetCustomAttributes (this ICustomAttributeProvider self) { return null; } public static void Main () { } }