public abstract BaseClass
{
public abstract Dictionary<T, V> ExtractSummaryInfo<T, V>()
where V : Product;
}
public MyClass : BaseClass
{
public override Dictionary<T, V> ExtractSummaryInfo<T, V>()
{
Dictionary<T, V> products = new Dictionary<T, V>();
string id = "HRM";
Product product = new Product("Product 1");
products[id as T] = product as V;
return products;
}
}
このコード行 (products[id as T] = product as V;) が間違っているように思えます。このメソッドの実装方法を教えてください。