title: Entity Framework not including columns with default value in insert into query
body: <p>I have a model that has some columns defined with default values like  </p>
  
  <pre><code>table.Column&lt;bool&gt;(nullable: false, defaultValueSql: "1")
  </code></pre>
  
  <p>When I save a new entity in the database using <code>context.SaveChanges()</code>, I noticed that the columns with default values are not included in the insert into query that Entity Framework generates, so the values generated in the database are the default ones instead of the ones I'm passing in the model. </p>
  
  <p>Do I have to set up some property in the context to be able to set these properties through code? I'm using EF Core, but I don't know if this is a general behavior of all EF versions. </p>
  
  <p>UPDATE: the code is pretty simple. This is pseudo code of what I have.
  The Model has some properties defined with constraints such as the one I describe above 
  <code>table.Column&lt;bool&gt;(nullable: false, defaultValueSql: "1")</code></p>
  
  <p>I'll use column MyBooleanProperty as an example. I have in a service:</p>
  
  <pre><code>var newModel = new GEAddress();
  newModel = someEntity.MyBooleanProperty; //it is false,but ends up as 1 in the database
  </code></pre>
  
  <p>I'm using Unit Of Work and Repositories so I have </p>
  
  <pre><code>_unitOfWork.MyModelRepository.Add(newModel);
  _unitOfWork.SaveChanges();
  </code></pre>
  
  <p>In the output window of VS, I see how it send all properties in an <code>INSERT INTO</code> query and then it does a <code>SELECT</code> on the properties with default values. The result is the newModel in the database with all the values I sent, except the columns with default values.
  I cannot change the configuration for those tables since it's being used by another system that needs those rules.  </p>
  
  <p>I would like to know an explanation on why this is happening more than a solution. I can work around this, but I'd like to know why this behavior is happening</p>