If I was using the .NET framework version of EF, I'd simply do using(var db = new dbContext()) and I'd be able to instantiate a new context and insert data using db.<tableName>.add()
However, this doesn't work for .NET core. When I attempt to instantiate a new context, I get an error message requiring that a
DbContextOptions object is passed through to the context object to instantiate it.
This is DbContext class:
public SolicitorContext(DbContextOptions<SolicitorContext> options) : base(options)
{
}
Obviously the options object needs to be passed through here to init the object.
public SolicitorContext() { }