A few years ago, I wrote a library that encapsulated a variety of SharePoint 2010 tasks in C# code. This library represented the sum total of my SharePoint API knowledge. I am releasing it on GitHub now. I waited this long to release the code because someone with enough programming knowledge and courage could have taken my library and done the same work I was doing. I was leery of enabling my own competition. I’ve decided that my fear was baseless. Also, Microsoft has pushed for new development to be done with theOffice 365 API’s. That said, you should be able to automate 75% of SharePoint tasks in C# using my library, having this code made me a lot more productive!
Here are some caveat’s:
You really shouldn’t be doing new development with this library. It was developed for SharePoint 2010 and it is most useful as tutorial or insight into the inner workings of SharePoint. You should be using the new app model most of the time.
The code is production tested but use it at your own risk. When you copy and paste this into your production SharePoint solution (Who are we kidding? I know you will!) don’t send your boss my email address and say “Idaho made me do it!”
This library has a design quirk. I used the service locator pattern and dependency injection. Theoretically, it should have been possible to have a different implementation for each SharePoint web application, site collection, and web. If you incorporate the assembly in your solution don’t make the same mistake I did – don’t ever change the source code of the assembly once it is on your SharePoint farm. Deployments will quickly become nightmarish! To make modifications create a new assembly and use the service locator to replace my code with yours by implementing the same interface.
Get the GitHub repository here: https://github.com/utdcometsoccer/MySP2010Utilities