Entity Framework map multiple tables to one entity

前端 未结 5 710
抹茶落季
抹茶落季 2021-01-18 04:50

I have a database with a table for active orders and one for inactive orders. I would like to model this in Entity Framework as one entity called Orders. I also need a way t

5条回答
  •  被撕碎了的回忆
    2021-01-18 05:23

    I think this is what you are looking for: How to: Define a Model with Multiple Entity Sets per Type (Entity Framework)

    "The Entity Data Model (EDM) allows an entity type to be included by multiple entity sets within a single entity container or for an entity type to be included in entity sets in multiple entity containers. Defining multiple entity sets per type (MEST) allows users to streamline their code when databases have partitioning or other such scenarios where multiple tables have the same structure."

提交回复
热议问题