title: Separation of ASP.NET Core Identity ApplicationUser with relationship to Domain Model Entity
body: <p>I'm trying to achieve good separation and architecture between ASP.NET Core Identity and entities in my domain model.</p>
  
  <p>I'm using an Onion architecture in a web application built with ASP.NET Core.
  In the core project, <code>Domain</code>, I have domain models, and one of them being a <code>Member</code> entity. </p>
  
  <p>Then in another project, <code>Infrastructure</code>, I have the built in ASP.NET Core Identity setup which contains an <code>ApplicationUser</code> class that inherits from <code>IdentityUser</code>.</p>
  
  <pre class="lang-cs prettyprint-override"><code>    public class ApplicationUser : IdentityUser
      {
      }
  </code></pre>
  
  <p>The idea of having the identity user and member entity separated is good. 
  However, I want to relate them but using Entity Framework Core this seems to be a challenge. I cannot get around this without adding navigation properties in my domain models, which I'd like to avoid.</p>
  
  <p>I was hoping I could do it entirely using Fluent API without having to add properties but that does not seem to be the case. </p>
  
  <p>Any recommendations on how to approach this?
  Considering the above how could I create a relationship between the identity user and a domain entity without adding dependencies from the core project?</p>
  
  <p>My question is somewhat a duplicate or related to some of these posts here e.g.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/26580209/decoupling-asp-net-identity-from-the-core-domain-models-onion-architecture">Decoupling ASP.NET Identity from the Core Domain Models - Onion Architecture</a></li>
  <li><a href="https://stackoverflow.com/questions/30729139/onion-architecture-identity-framework">Onion Architecture Identity Framework</a></li>
  <li><a href="https://stackoverflow.com/questions/50445592/add-relationship-to-net-identity-applicationuser-for-entity-in-data-layer">Add relationship to .NET Identity ApplicationUser for entity in Data layer
  </a></li>
  </ul>
  
  <p>and some other posts as well. However, the answers to these questions seems to be workarounds. Maybe that is the only way?</p>
  
  <p>I'm using ASP.NET Core 3.1 and Entity Framework 3.1. for this project.</p>