在Startup.cs类I依赖项注入中:public void ConfigureServices(IServiceCollection我创建了新的MyStubsProject,它引用了MyProject。我实现了MyStubsProject的IMyService存根版本。// MyStubsProject project
public class MyStub
在我的工作中,我们正在开发ASP.NET核心应用程序。我一直看到依赖注入时使用的折叠模式。throw new ArgumentNullException(nameof(myOtherLogic));}
在服务配置期间,所有依赖项都会添加到IServiceCollection中,并且两者(Logic和OtherLogic)都只能从依赖项注入中检索。在我的当前项目中,我使