I don't know your concrete use-case, but the example will still compile if you drop the non-generic method and instead constrain the generic method to IBase public interface IBase {} public interface IChildA : IBase {} public interface IChildB : IBase {} public static class BaseExtensions { public static T Touch(this T self) where T : IBase { return self; } } public static class TestClass { public static void Test() { IChildA a = null; IBase firstTry = a.Touch(); IChildB be = null; IChildB touchedB = b.Touch(); } }.
I don't know your concrete use-case, but the example will still compile if you drop the non-generic method and instead constrain the generic method to IBase. Public interface IBase {} public interface IChildA : IBase {} public interface IChildB : IBase {} public static class BaseExtensions { public static T Touch(this T self) where T : IBase { return self; } } public static class TestClass { public static void Test() { IChildA a = null; IBase firstTry = a.Touch(); IChildB be = null; IChildB touchedB = b.Touch(); } }.
The easiest way to avoid this type of extension type resolving conflicts is to simply rename the extension method. It might not be the most elegant way of dealing with the problem, but it's the cleanest solution I can think of: public interface IBase {} public interface IChildA : IBase {} public interface IChildB : IBase {} public static class BaseExtensions { public static IBase Touch(this IBase self) { return self; } public static T TouchB(this T self) where T : IChildB { return self; } } public static class TestClass { public static void Test() { IChildA a = null; IBase firstTry = a.Touch(); IBase secondTry = ((IBase)a).Touch(); IChildB be = null; IChildB touchedB = b.TouchB(); } } You could also have the IBase method perform a type check and execute the TouchB() method if the current type is of IChildB: public static IBase Touch(this IBase self) { if (self is IChildB) return ((IChildB)self).TouchB(); return self; }.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.