[英]Exposing 3rd party library through own library?
I have the following dependency structure: 我具有以下依赖关系结构:
ProjectA -> ProjectB -> Dapper
I want to allow ProjectA
to have access to Dapper's functionalities. 我想允许
ProjectA
访问Dapper的功能。 Is it possible to do it with ProjectB
"exposing Dapper" to ProjectA
, instead of independently adding Dapper to ProjectA
via nuget? 是否可以通过
ProjectB
将Dapper暴露给ProjectA
,而不是通过nuget单独将Dapper添加到ProjectA
呢?
You can either wrap what you need and expose your own abstractions, so that project a does not even need to know that dapper exists, or just reference the package in both libraries. 您可以包装所需的内容并公开自己的抽象,以便项目a甚至不需要知道dapper的存在,或者只引用这两个库中的包。
If you're not trying to achieve anything in particular, like abstraction of the specific implementation, just reference it from both. 如果您不打算实现任何特定的目的,例如特定实现的抽象,只需从两者中引用即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.