I am currently trying to set up a database connection with a .Net Core V3.1 library.
However, I cannot seem to figure out how I can parse my connection string into the dbcontext class. All the articles I have been able to find online, points to ASP.Net Core applications with a startup class. I do not have such a class.
In regular .Net I could simply do something like:
public MyContext() : base("db.connection.mycontext")
{
}
public DbSet<someClass> Objects { get; set; }
And it would fetch the correct file from my app.config file. How can I do something similar in .Net Core? Currently I am just setting up a local service-database from Visual Studio 2019, that I am intending to use for testing, and would like to have similar setup as shown above.
As a side note, I am using EFCore code-first to model the schemas (if this have any relevance).