Silverlight RIA Services DomainContext Life

For an entity infrastructure context, the best practice is only that your context hangs around as much as you need. Is the same true for the Silverlight domain context, or is it “safer” to hold it longer? If you can create an instance once and make it a variable in the application area, can you add it to the ApplicationLifeTimeObjects list?

+3
source share
2 answers

DomainContext is just a set of changes, so its use is determined by your business rules.

As long as you save the changes in order to avoid data loss, I do not know about any reason to stop reusing only the DataContext for the duration of the application.

+3
source

Mmm ... paralellism, memory consumption, lack of isolation (you should know that you need to clean up memory changes that you need to discard when you go to another page). For some scenarios, this may make sense for some others, maybe not?

0
source

Source: https://habr.com/ru/post/1774503/


All Articles