Click here to Skip to main content
12,945,927 members (61,069 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 15 Apr 2014

SharePoint Mapper (SPMapper)

, 23 May 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
A SharePoint Server Object Model List Mapper to CRUD


The CRUD action is one of the common actions to do with data. SharePoint represents 2 types of Object Model: one is Client Object Model and the other is Server Object Model and you can do CRUD via these models (according to the privilege).

The main target of this tip is announcing the first release of SPMapper. Through this component, you can work with Server Object Model & do CRUD actions as easy as drinking a glass of water.

Homepage of SPMapper and download link.

Update (05/23/2014):

Now available on Nuget:

PM > Install-Package MBS.SharePoint.Mapper


It's better to know the Server Object Model.

Please read the Privacy Policy at first (It's not open source but it's free.)

Using the Code

This component allows you to work with CRUD actions, also works with attachments of a SharePoint list.

This component has an Entity Based Approach to SharePoint list .

This component allows you to work with data easily:

using Seifollahi.SPMapper;
public partial class SPMapprTestWebpartUserControl : UserControl
        protected void Page_Load(object sender, EventArgs e)
                if (!IsPostBack)

void SampleMethodForSelectData()
   // get the SPWeb object
   var myweb = new Web(SPContext.Current.Web);
   // make a Mapper object
   Mapper< MyListEntityClass> myListObject = new Mapper< MyListEntityClass>(myweb);
   // get all attachments of a listitem with ID = 8
   Attachment item8_attachments = myListObject.SelectAttachment(8);
   // get the item with ID 8
   MyListEntityClass item8 = myListObject.Select(8);
   // make your SPQuery Object
   SPQuery myQry = new SPQuery{ Query = "..." };
   // Select your data as a list of your entity class
   List< MyListEntityClass> result = myListObject.Select(myQry);
   gridview1.DataSource = result;

To learn more about how it works and how you should code, please refer to First Version documents.

As a developer, you have the ability to customize your classes. Please read the advanced section in the first version. Also, you can work with attachment.

Points of Interest

This component also has a QueryPaging<T> class that helps you in pagination of SharePoint List Items.

Please read all documentation!

Happy Coding!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

MB Seifollahi
Software Developer 1
Iran (Islamic Republic of) Iran (Islamic Republic of)
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170518.1 | Last Updated 23 May 2014
Article Copyright 2014 by MB Seifollahi
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid