![](/img/trans.png)
[英]How to Display List of Classes and it properties in a propertygrid that implement an interface C#
[英]Implement Interface with List and get Value c#
我有一個名為IConnector的接口
具有以下屬性:
[OperationContract]
List<Details> RequestDetailsSchedule();
[OperationContract]
bool SetDetailsSchedule(List<Details> lstDetails);
我嘗試實施
public class Regulator: IConnector
public List<Details>RequestDetailsSchedule
{
throw new NotImplementedException();
}
我如何獲得清單的內容?
這是實現接口的最基本方法。
public class Regulator: IConnector
{
public List<Details> RequestDetailsSchedule()
{
throw new NotImplementedException();
}
public bool SetDetailsSchedule(List<Details> lstDetails)
{
throw new NotImplementedException();
}
}
清單來自哪里? 數據庫? 無論如何,只是因為您要提出一個抽象,所以我會一直這樣做,就像這樣:
public interface IConnector {
IEnumerable<Details> RequestDetailsSchedule();
bool SetDetailsSchedule(IEnumerable<Details> details);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.