public static class Extensions
{
public static T DoSomething<T>(this T obj)
{
//...
}
}
Чтобы расширить конкретный общий класс
public static NeedExtension<T> DoSomething<T>(this NeedExtension<T> obj)
{
//...
}
personStan R.schedule18.02.2010
comment
Для меня я забыл ‹T› после NeedExtension. В частности, я хотел написать расширение для универсального класса Dictionary, поэтому мне понадобился ‹TKey,TValue›.
- personVincent Vancalbergh; 10.10.2018