How to get connectionString from EF Core 2.0 DbContext : <p>In EF6 works this code:</p>

<pre><code>    public string GetConnectionString(DbContext ctx)
    {
        ObjectContext _objectContext = ((IObjectContextAdapter)ctx).ObjectContext;
        if (_objectContext?.Connection != null)
        {
            EntityConnection entityConnection = _objectContext.Connection as EntityConnection;
            return entityConnection?.StoreConnection?.ConnectionString;
        }
        return null;
    }
</code></pre>

<p>How to do it in EF Core 2.0 ?</p>
