How do I insert data into my database using Entity Framework .NET Core?

c# entity-framework-core

Popular Answer

var dbOptions = new DbContextOptionsBuilder<YOURCONTEXT>()
            .UseSqlServer(connectionString: Environment.GetEnvironmentVariable("YOURCONNSTRING"))
            .Options;

using (var yourDB = new YOURCONTEXT(dbOptions))
{
}
2
10/15/2018 3:56:25 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow