title: EF Core: Optional one-to-one foreign key relation from content entity
body: <p>I've implemented some database context for my .net core blazor application. 
  The database context has access to an external database (no database migration etc.) </p>
  
  <p>Now my problem is that I am not sure how to define a foreign key using fluent api or data attributes when the parent table contains the foreign key for the table. </p>
  
  <p>As simplified example: I've got a transactions entity with data like this:</p>
  
  <pre><code>[Table("transactions")]
  public class Transaction
  {
    [Key]
    [Column("id")]
    public int Id { get; set; }
  
    [Column("trans_num")]
    public string TransNum { get; set; }
  
    [Column("shop_id")]
    public int? ShopId { get; set; }
  
    [Column("total_amount")]
    public decimal TotalAmount { get; set; }
  
    public Shop Shop { get; set;}
  }
  </code></pre>
  
  <p>And some shop entity with data like this: </p>
  
  <pre><code>[Table("shops")]
  public class Shop
  {
    [Key]
    [Column("id")]
    public int Id { get; set; }
  
    [Column("shop_name")]
    public string ShopName{ get; set; }
  
    public Transaction Transaction { get; set;}
  }
  </code></pre>
  
  <p>As the models indicate, the "shop_id" is the foreign key.</p>
  
  <p>So ... I've got no transaction reference within my shop entity. Also, in my productive scenario I've got some optional relations like this, meaning for example shop_id would be null. </p>
  
  <p>How would I indicate the optional relation to my model builder? </p>
  
  <p>Best regards</p>