.Net Core appsettings.json connection string
See original GitHub issueNot sure if it is just me, but I am not able to get the DataConnection to pick up the connection string from the config file in a .Net core WebApi app.
I’ve tried the normal web.config, appsettings.json, app.config and none of them work. I’ve tried:
- Linq2DB-1.7.6
- Linq2DB Core and
- linq2db.Core -Version 1.7.7-rc547 in a blank, .Net Core (.Net Framework) WebApi project in VS2015.
public class DbContext : LinqToDB.Data.DataConnection
{
public DbContext(string configuration) : base(configuration)
{
..//
}
}
using (var dtx = new DbContext("DataConnection"))
{
..//
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Store and read connection string in appsettings.json
Store and read connection string in appsettings.json ... In .NET Core and ASP.NET Core applications the application settings are stored in a JSON...
Read more >Connection Strings - EF Core
In ASP.NET Core the configuration system is very flexible, and the connection string could be stored in appsettings.json , an environment ...
Read more >c# - Get ConnectionString from appsettings.json instead of ...
You can also do this in ASP.NET Core 2 by defining the connection string in your appSettings.json file. Then in your Startup.cs you...
Read more >How to Get Connection String from Appsettings.json? .net ...
Add an AppSettings.json File. Right-click on the project and select 'Add New Item'. In the search box type 'json' keyword and select 'JavaScript...
Read more >Net Core: Read Connection String from AppSettings.json file
json file, right click on the Project in Solution Explorer. Then click Add, then New Item and then choose App Settings File option...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
maybe look at this https://github.com/linq2db/linq2db/blob/master/Tests/Tests.NetCore/ConfigurationTest.cs
Hello, now for .Net Core there is the package System.Configuration.ConfigurationManager. Is it possible to update documentation to explain how to use ConfigurationManager in .Net Core console applications?
Thank you!