如何在ASP.NET Core 3.1中的类库项目中获取连接字符串
我在AppSettings.json中在我的ASP.NET Core Web API项目中从数据访问层中获取连接字符串。数据访问层中的项目是类库项目。我使用了DB的第一种方法
I'm having trouble getting the connection string in appsettings.json in my asp.net core web API project from the data access layer. The project in the data access layer is the class library project. I used DB first approach
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的班级中注入“ IconFiguration”。请按照以下代码:
Inject 'IConfiguration' in your class. follow below code: