我有一個使用以下類型的接口工廠類返回一個通用接口
interface IActivity<T>
{
bool Process(T inputInfo);
}
具體類是像如下
class ReportActivityManager :IActivity<DataTable>
{
public bool Process(DataTable inputInfo)
{
// Some coding here
}
}
class AnalyzerActivityManager :IActivity<string[]>
{
public bool Process(string[] inputInfo)
{
// Some coding here
}
}
現在我該怎麼寫這個工廠類retuns一些具體一個像IActivity這樣的通用接口。
class Factory
{
public IActivity<T> Get(string module)
{
// ... How can i code here
}
}
感謝
得到錯誤..錯誤CS0050:可訪問性不一致:返回類型 – Anish