Код: Выделить всё
public interface IFeature
{
public T Value { get; set; }
}
Код: Выделить всё
public class SharepointFeature : IFeature
{
public string Value { get; set; }
}
Код: Выделить всё
public T GetFeature() where T : IFeature
{
// some logic
}
Код: Выделить всё
public void Test()
{
// This one is working
var feature = GetFeature();
// Desired version
var feature = GetFeature(); // I want to only specify one generic argument
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... class-in-c
Мобильная версия