How to hide extension methods from derived classes?
问题 I have a base abstract class to implement template method pattern. public abstract class OptionalParameter { //Template Method Pattern public string GenerateQueryString() { return this.GenerateQueryStringWithParameters(); } } And I have an extension method for all OptionalParameter type. public static class OptionalParameterExtensions { public static string GenerateQueryStringWithParameters(this OptionalParameter optionalParameters) { } } I inherited a class from OptionalParameter named