Entity framework context as static

Almost definitely not.

ObjectContexts get bigger and bigger as more Objects are queried / saved.

Also sharing an ObjectContext between threads, as you would be doing, is not recommended, because of the locking issues and undeterministic side-effects you would have to deal with.

I wrote a tip on this topic a while back.

Tip 18 – How to decide on a lifetime for your ObjectContext

Leave a Comment