假定有三个工程:A、B、C;其中A为接口,B为实现,C为应用。

    我在A中设置接口:IDocuments,其中包含Creater-单据创建者属性;然后在B中引用A,创建一个继承接口IDocuments的Documents的类,实现Creater属性。

    最后,我在C中引用A,声明一个IDocuments类型的变量:

    IDocuments doc=new (?);

    由于我只引用了接口,所以我看不到Documents的类,而又不能直接写成IDocuments doc=new IDocuments();

    请问,我该如何操作呢?

    接口能都放在单独的一个文件中吗?

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2022-01-08
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-11-14
  • 2022-12-23
  • 2021-07-09
相关资源
相似解决方案