Mapping the model to multiple tables with EntityFramework.Core

With EntityFramework Core, we can use attributes or Fluent API to config the model mappings. One day I just got a scenario that needs a new mapping style. There is a system that generates lots of data every day and it needs to store the data per table for each day. For example, the database looks like:

All the tables have the same structure. So how could we change the mapping to avoid creating lots of models?

In this article, I will show you how to change the mapping to handle this situation. You…