Update the documentation pages

This commit is contained in:
OpenIddict Bot
2023-05-02 19:58:39 +00:00
parent 55127dcfe7
commit ea52e730fc
160 changed files with 9194 additions and 5001 deletions

View File

@@ -2,15 +2,15 @@
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Entity Framework 6.x integration </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Entity Framework 6.x integration ">
<meta name="generator" content="docfx ">
<meta name="generator" content="docfx 2.56.7.0">
<link rel="shortcut icon" href="../images/favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/night-owl.min.css">
@@ -19,9 +19,9 @@
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body>
@@ -31,7 +31,7 @@
<svg name="Hamburger" style="vertical-align: middle;" width="24" height="24" viewbox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M20 6H4V9H20V6ZM4 10.999H20V13.999H4V10.999ZM4 15.999H20V18.999H4V15.999Z"></path></svg>
</a>
<a class="brand" href="../index.html">
<img src="../images/logo.png" alt="OpenIddict" class="logomark">
<span class="brand-title">OpenIddict</span>
@@ -46,25 +46,25 @@
<div class="sidebar">
<div>
<a class="brand" href="../index.html">
<img src="../images/logo.png" alt="OpenIddict" class="logomark">
<span class="brand-title">OpenIddict</span>
</a>
<div id="navbar">
</div>
</div>
<div class="sidebar-item-separator"></div>
<div id="sidetoggle">
<div id="sidetoc"></div>
</div>
@@ -72,8 +72,8 @@
</div>
<div class="footer">
<span>Generated by <strong>DocFX</strong></span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</nav>
@@ -81,7 +81,7 @@
<div role="main" class="hide-when-search">
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
@@ -94,12 +94,11 @@
<h1 id="entity-framework-6x-integration">Entity Framework 6.x integration</h1>
<h2 id="basic-configuration">Basic configuration</h2>
<p>To configure OpenIddict to use Entity Framework 6.x as the database for applications, authorizations, scopes and tokens, you'll need to:</p>
<p>To configure OpenIddict to use Entity Framework 6.x as the database for applications, authorizations, scopes and tokens, you&#39;ll need to:</p>
<ul>
<li><p><strong>Reference the <code>OpenIddict.EntityFramework</code> package</strong>:</p>
<pre><code class="lang-xml">&lt;PackageReference Include=&quot;OpenIddict.EntityFramework&quot; Version=&quot;3.1.1&quot; /&gt;
</code></pre>
</li>
</code></pre></li>
<li><p><strong>Create a database context deriving from <code>DbContext</code> and register the OpenIddict entities in the model</strong>:</p>
<pre><code class="lang-csharp">public class ApplicationDbContext : DbContext
{
@@ -110,8 +109,7 @@
modelBuilder.UseOpenIddict();
}
}
</code></pre>
</li>
</code></pre></li>
<li><p><strong>Configure OpenIddict to use the Entity Framework 6.x stores</strong>:</p>
<pre><code class="lang-csharp">services.AddOpenIddict()
.AddCore(options =&gt;
@@ -119,8 +117,7 @@
options.UseEntityFramework()
.UseDbContext&lt;ApplicationDbContext&gt;();
});
</code></pre>
</li>
</code></pre></li>
<li><p><strong>Use migrations or recreate the database to add the OpenIddict entities</strong>.
For more information, read <a href="https://docs.microsoft.com/en-us/ef/ef6/modeling/code-first/migrations/">Code First Migrations</a>.</p>
</li>
@@ -128,9 +125,7 @@ For more information, read <a href="https://docs.microsoft.com/en-us/ef/ef6/mode
<h2 id="advanced-configuration">Advanced configuration</h2>
<h3 id="use-a-custom-primary-key-type">Use a custom primary key type</h3>
<p>By default, the Entity Framework 6.x integration uses <code>string</code> primary keys, which matches the default key type used by ASP.NET Identity.</p>
<div class="WARNING">
<h5>Warning</h5>
<p>Unlike Entity Framework Core, Entity Framework 6.x doesn't support closed generic types, which prevents using the OpenIddict entities
<div class="WARNING"><h5>Warning</h5><p>Unlike Entity Framework Core, Entity Framework 6.x doesn&#39;t support closed generic types, which prevents using the OpenIddict entities
without subclassing them. As such, using a custom primary key type is a bit more complicated with Entity Framework 6.x than with
Entity Framework Core and requires implementing custom entities, as highlighted in the next section.</p>
</div>
@@ -157,8 +152,7 @@ public class CustomToken : OpenIddictEntityFrameworkToken&lt;long, CustomApplica
{
public string CustomProperty { get; set; }
}
</code></pre>
</li>
</code></pre></li>
<li><p><strong>Call the generic <code>ReplaceDefaultEntities&lt;TApplication, TAuthorization, TScope, TToken, TKey&gt;()</code> method to force OpenIddict to use the custom entities</strong>:</p>
<pre><code class="lang-csharp">services.AddOpenIddict()
.AddCore(options =&gt;
@@ -168,8 +162,7 @@ public class CustomToken : OpenIddictEntityFrameworkToken&lt;long, CustomApplica
.UseDbContext&lt;ApplicationDbContext&gt;()
.ReplaceDefaultEntities&lt;CustomApplication, CustomAuthorization, CustomScope, CustomToken, long&gt;();
});
</code></pre>
</li>
</code></pre></li>
<li><p><strong>Register the custom entities in the model</strong>:</p>
<pre><code class="lang-csharp">public class ApplicationDbContext : DbContext
{
@@ -180,8 +173,7 @@ public class CustomToken : OpenIddictEntityFrameworkToken&lt;long, CustomApplica
modelBuilder.UseOpenIddict&lt;CustomApplication, CustomAuthorization, CustomScope, CustomToken, long&gt;();
}
}
</code></pre>
</li>
</code></pre></li>
</ul>
</article>
@@ -189,16 +181,16 @@ public class CustomToken : OpenIddictEntityFrameworkToken&lt;long, CustomApplica
</main>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
<script type="text/javascript" src="../styles/jquery.twbsPagination.js"></script>
<script type="text/javascript" src="../styles/url.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
<script type="text/javascript" src="../styles/jquery.twbsPagination.js"></script>
<script type="text/javascript" src="../styles/url.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>