我向用户公开的旧版接口是这样的:
public interface IReporter
{
void Write(int site, DateTime start, DateTime end);
}
Run Code Online (Sandbox Code Playgroud)
现在我想替换函数中的参数,如下所示:
public interface IReporter
{
void Write(int site, SiteLocalDateTime start, SiteLocalDateTime end);
}
Run Code Online (Sandbox Code Playgroud)
我希望现有客户使用旧方法和新客户来使用新方法.
有关如何通过暴露单一界面实现这一点的任何想法?
选项:
保持两个接口IReporter和IReporterNew : IReporter
现在所有我的新实现都需要使用这两种方法.
不可能暴露两个界面.