I want to use Entity Framework to a load a number of sql tables into memory from my c# app before performing some work on them and sending changes back to the database. I only want to hit the database once when I load the data and once more when I update changes. Should I load the tables into a dataset or is there a better way to achieve this?
Share
In such case you can’t use entity framework. Entity framework will hit database for once for loading each table (unless there are relations which can load all tables in single query as @Jakub suggested) and it will hit database for each performed change. EF doesn’t have command batching and each modified, inserted or deleted entity will cause separate roundtrip to DB.