title: EF6 Fluent Api - I need to set Default value in FluentApi in order to Map Child to be used instead of Parent
body: <p>Here's part of the setup. Names are simplified: 
  I have following classes:</p>
  
  <ul>
  <li>MyClass  </li>
  <li>MySubclass1 : MyClass </li>
  <li>MySubClass2 : MyClass</li>
  </ul>
  
  <p><code>MyClass</code> is part of another class (and table), which I will leave out.</p>
  
  <p>I'm trying to do an <strong>EF6 query</strong> (using <code>context.Set&lt;MyClass&gt;.Where(...)</code>)</p>
  
  <p>I want to return the subclasses instead of the parent class and I want to avoid using the <code>Discriminator</code>. The reason is: there is a property on MyClass that already defines whether it's <code>MySubclass1</code> or <code>MySubclass2</code>.
  The property is called <code>KindId</code> and is an <code>FK</code> to a lookup table (<code>Kinds</code>).</p>
  
  <p>The EF-part is being autogenerated as follows:</p>
  
  <pre><code>public partial class MyClassMap : EntityTypeConfiguration&lt;MyClass&gt;
  {
      public MyClassMap ()
      {
          ToTable("MyClasses", "MySchema");
          //...etc (other implementations)
  
          HasRequired(c=&gt; c.Kind)
              .WithMany(kind =&gt; kind.MyClasses)
              .HasForeignKey(c =&gt; new { c.KindId });
  
          Initialize();
      }
  
      partial void Initialize();
  }
  </code></pre>
  
  <p>This means, I can only update Initialize().
  I have done so as follows:</p>
  
  <pre><code>public partial class MyClassMap 
  {
      partial void Initialize()
      {
          Map&lt;MySubclass1&gt;(c =&gt; c.Requires("KindId").HasValue(1));
          Map&lt;MySubclass2&gt;(c =&gt; c.Requires("KindId").HasValue(2));
      }
  }
  </code></pre>
  
  <p>When I run the EF query, I'm getting following exception:</p>
  
  <blockquote>
    <p>error 3023: Problem in mapping fragments starting at lines x:Column
    MyClass.KindId has no default value and is not nullable. A column value
    is required to store entity data.</p>
  </blockquote>
  
  <p>I tried setting the default value on the DB, but I think it requires the Default to be set within EF. 
  <strong>Question is: how do I do this using the FluentApi?</strong></p>