title: Ignore extra property from entity while getting data from DB using EF Core
body: <p>I am using EF Core. I want to extract data from the database using a stored procedure and EF Core. I am getting error for those property whose are not returned from DB. How can I fix this?</p>
  <p>Entity:</p>
  <pre><code>public class CustomOverview
  {
      public int A{ get; set; }
      public int? B{ get; set; }
      public int? C{ get; set; }
      public int? D{ get; set; }
  }
  </code></pre>
  <p>Repository code</p>
  <pre><code>public async Task&lt;CustomOverview&gt; GetMyData()
  {
      return  _dbContext.CustomOverviews.FromSqlInterpolated($&quot;exec spr_myStoredProcedure).AsEnumerable().FirstOrDefault();
  }
  </code></pre>
  <p>My stored procedure returns data for Column A, Column B.</p>
  <p>When I run the code, I get this exception:</p>
  <blockquote>
  <p>InvalidOperationException: The required column 'C' was not present in the results of a 'FromSql' operation.</p>
  </blockquote>
  <p>How can I resolve it? There is many solution where they suggest to remove property or use <code>[NotMapped]</code> attribute before the property. But my requirement is I need those property for different stored procedure. So I couldn't remove them.</p>