【问题标题】:.net core 2.2. Circular References.net 核心 2.2。循环引用
【发布时间】:2019-01-12 07:30:19
【问题描述】:

我对引用有疑问并感到困惑。

在 DLLRepository.Implement 中我可以看到 DLLModel 并使用存储库层中的模型。

当我想在 DLLInfrastructure 和 DLLModel 之间添加引用时,请说它的循环引用。

在这个pic可以看到我的解决方案基础架构

我应该怎么做才能解决间接引用?

【问题讨论】:

    标签: reference .net-core circular-reference


    【解决方案1】:

    Repository.Model 依赖于什么?如果您在 Repository.ImplementRepository.Infrastructure 都引用 Repository.Model 时获得循环引用,则 Model 必须依赖(或依赖于)ModelInfrastructure

    要解决问题,您必须确定导致循环的项目并打破它。这可能意味着重构您的代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-24
      • 1970-01-01
      • 2019-12-10
      • 2022-01-19
      • 2019-12-27
      • 2019-08-26
      • 2018-06-30
      • 1970-01-01
      相关资源
      最近更新 更多