I think my question is very similar to this question: Protobuf-net creating typemodel with interface and abstract baseclass however the solution given by Marc here, essentially reduces the multiple inheritance of an abstract class and interface down into a single inheritance design.
对我来说,问题是,我实际上需要 多重接口继承 像这样:
interface ITestBase
{
}
abstract class TestBase : ITestBase
{
}
class TestTypeA : TestBase, ITestTypeA
{
}
interface ITestTypeA
{
}
class TestTypeB : TestBase, ITestTypeB
{
}
interface ITestTypeB
{
}
在这里,我不能轻描淡写,让测试基地实施 ITestTypeA 或 ITestTypeB (这是另一个问题的解决方案), 因为具体等级的测试TypeA 应该同时实施 ITestTypeA 和 ITestbase, 测试TypeB 应该实施 ITestTypeB 和 ITestbase 。
我使用原生泡沫网 v2.0.0.480