Home > Net > EntityFrameworkCore to use and is not the same as in my imagination
EntityFrameworkCore to use and is not the same as in my imagination
Time:05-21
My program is running to save some records, data volume is small, My wish is to load the application runtime database, put out all the data in the memory, So I run the program to modify data in the memory, in has been detected by the ef, When I SaveChanges (), update the data in the change to the database,
However, when I use the First () positioning data, found the program or to access the database, I think this visit is completely unnecessary, because the data in memory, Whether using EntityFrameworkCore usage as I described above?
That is, read only once, the data change, save, Search data don't access the database again, because there are data in memory,
CodePudding user response:
Ha, last time there was a stick that how to always read cache, how to read the database every time, This post is just like that is on the contrary,
You should consider whether the data tracking, or the life cycle of EF context