title: String as foreign key - cannot convert lambda expression to type 'string' because it is not a delegate type
body: <p>I have an <code>ApplicationUser</code> and a <code>Group</code>:</p>
  
  <pre><code>public class ApplicationUser : IdentityUser
  {
      public int? GroupId { get; set; }
      public Group Group { get; set; }
      // ... some more properties
  }
  
  public class Group
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string GroupAdminId { get; set; }
      public ApplicationUser GroupAdmin { get; set; }
      public List&lt;ApplicationUser&gt; GroupUsers { get; set; }
  }
  </code></pre>
  
  <p>The idea is that a group has one admin-user and many ordinary users. Also, an <code>ApplicationUser</code> can only be a member of one <code>Group</code>, either as an admin or an ordinary user.</p>
  
  <p>The PK for <code>ApplicationUser</code> is of type <code>string</code> (Guid).</p>
  
  <p>I'm trying to define the relationships in <code>OnModelCreating()</code>, but I'm not doing it right:</p>
  
  <pre><code>modelBuilder.Entity&lt;Group&gt;()
      .HasOne(a =&gt; a.GroupAdmin)
      .WithOne(g =&gt; g.Group)
      .HasForeignKey(a =&gt; a.GroupAdminId);
  </code></pre>
  
  <p><code>.HasForeignKey(a =&gt; a.GroupAdminId)</code> causes this error:</p>
  
  <blockquote>
    <p>Error CS1660  Cannot convert lambda expression to type 'string' because it is not a delegate type</p>
  </blockquote>
  
  <pre><code>modelBuilder.Entity&lt;Group&gt;()
      .HasMany(u =&gt; u.GroupUsers)
      .WithOne(g =&gt; g.Group);
  </code></pre>
  
  <p>The configuration for <code>GroupUsers</code> doesn't show any errors, but since the <code>GroupAdmin</code>-part isn't working, I haven't tested it.</p>