Sitefinity ORM Context Management explained

This is too good of a google+ thread to not share LINK

If you don't want to read through, here's quick summary:

**Do not wrap your managers in using statements

using(DynamicModuleManager manager = DynamicModuleManager.GetManager()){  
   //Code  
}

Why?

Everytime you get a manager, sitefinity stores it for the duration of your http request. If you dispose it in a using statement it'll be disposed when that statement completes so the next control\widget that tries to use the manager will have to create a new instance of it (instead of just using the existing shared one).

Think of it like a bucket full of managers

Ready to Start?

Let's Build Something Amazing Together

Ready to bring your vision to life? We specialize in creating stunning websites, mobile apps, and digital experiences that make an impact.

Accepting new clients
Free consultation
15+ years experience