title: Table Partitions with Entity Framework Core
body: <p>I have a large database that will use partitioned column-store tables in a redesign. Is it possible to specify the partition in the generated sql with Entity Framework Core 2.2?</p>
  
  <p>This is for an Azure SQL hyperscale database with a table which currently contains about 3 billion rows. When using stored procedures to execute the requests performance is excellent but if the partition range is not specified in the query performance is less that optimal. I am hoping to move away from the inline sql we are currently using in the application layer and move to entity framework core. Being able to specify the partition for the tenant is our only blocker at the moment. </p>
  
  <p>This is an example where clause in the stored proceduure</p>
  
  <pre><code>Select @Range = $PARTITION.TenantRange(@InputTenantId)
  
  Select ..... FROM xxx where $PARTITION.TenantRange(TenantId) = @range
  </code></pre>
  
  <p>The above query would provide excellent performance but I am hoping I can make the same specification of the partition using entity framework.</p>