How to make Entity Framework cache some objects

后端 未结 3 1838
执笔经年
执笔经年 2020-12-07 15:43

I\'m using Entity Framework.

In my database are stored persons and country of their origins. When I\'m loading a person object I wan\'t to know what is the place eac

3条回答
  •  無奈伤痛
    2020-12-07 16:32

    I would cache that country list first and assign the appropriate country to each retrieved person. If you decide to also cache persons you should make them depend on the cached countries and invalidate them when you make any update to the countries/country list.

提交回复
热议问题