For those of you who are using EF core can do this as an alternative:
var databaseName = context.Database.GetDbConnection().Database
For those of you who are using EF core can do this as an alternative:
var databaseName = context.Database.GetDbConnection().Database