I see some pieces of the same error-prone code recur far too often in SharePoint. Probably most pervasive is the one to allow and not allow unsafe updates. In this post, I’ll provide a proper solution for this matter.

The code excerpt that will be familiar to many of you:

Here’s how you can solve it:

Usage:

This code ensures you don’t fiddle around with the settings that other components use. It’s nice and clean and it’s reusable across all projecs.

Leave a Reply