小编use*_*317的帖子

界面版本控制中的问题

我向用户公开的旧版接口是这样的:

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)

我希望现有客户使用旧方法和新客户来使用新方法.

有关如何通过暴露单一界面实现这一点的任何想法?

选项:

  1. 保持两个接口IReporterIReporterNew : IReporter 现在所有我的新实现都需要使用这两种方法.

  2. 不可能暴露两个界面.

.net c# interface

2
推荐指数
1
解决办法
92
查看次数

标签 统计

.net ×1

c# ×1

interface ×1