Use appsettings.json to configure DbContext mapping
<p>I'm using .netCore and Entity Framework to get some data from an SQL Database.<br>
I have setup a <code>DbContext</code></p>

<pre><code>public partial class DashboardContext : DbContext
{
    public NotfallDashboardContext(DbContextOptions&lt;NotfallDashboardContext&gt; options) : base(options) {}

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity&lt;DashboardData&gt;(entity =&gt;
        {
            ...
        }
    }

    public virtual DbSet&lt;DashboardData&gt; DashboardData { get; set; }
}
</code></pre>

<p>and inject it into my controller with the following setup</p>

<pre><code>services.AddDbContext&lt;DashboardContext&gt;(options =&gt; options.UseSqlServer(Configuration.GetConnectionString("DashboardDatabase")));
</code></pre>

<p>Now the <code>DashboardData</code> class uses the <code>Table</code> Attirbute to connect to the correct table and schema.</p>

<pre><code>[Table("TableName", Schema = "dbo")]
public partial class DashboardData
{
    ...
}
</code></pre>

<hr>

<blockquote>
  <p>What i would like to do, is to extract these two strings "TableName" and "dbo" into my appsettings.json configuration. I already added the configuration to appsettings, made a TableConfiguration class and setup dependency injection:</p>
</blockquote>

<p>TableConfiguration.cs</p>

<pre><code>public class TableConfiguration
{
    public string DatabaseView { get; set; }
    public string DatabaseSchema { get; set; }
}
</code></pre>

<p>appsettings.json  </p>

<pre><code>"TableConfiguration": {
    "DatabaseTable": "TableName",
    "DatabaseSchema": "dbo"
} 
</code></pre>

<p>startup.cs</p>

<pre><code>services.Configure&lt;TableConfiguration&gt;(Configuration.GetSection("TableConfiguration"));
</code></pre>

<blockquote>
  <p>Is it possible to inject or otherwise use the configuration in the DasboardData Attribute?</p>
</blockquote>