繁体   English   中英

使用列表实现接口并获取值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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM