This Post has been in my agenda for sometime but finally i got the time to write it:
I have done a lot of work with SharePoint API in my career path , and each time i see this code i become upset and feel angry even i wrote this code many times :
I have done a lot of work with SharePoint API in my career path , and each time i see this code i become upset and feel angry even i wrote this code many times :
using (SPSite site = new
SPSite(path))
{
using (SPWeb
web = site.OpenWeb())
{
//Do work
}
}
Project Solution (SPRepository) will consist of three Projects:
- SPRepository.Core (class
library): contains the Repository
- SPRepository.Domin (class
library) : Reference the (1) contains all entities
- SPRepository.Portal
(SharePoint Project). Reference (1 and 2) and contains web
parts(UI)
SPRepository.Core (class library):
The class diagram for
(SPRepository.Core) as below image (Figure1)
Two weeks ago
(today 3/10/2013) my manger asked me to make some changes on online
Portal.
I
got shocked on seeing hundreds of repeated codes.
I
went to Google and start searching (sharepoint document repository).
But
i didn’t find what i wants so i start reading and assembly parts to come up
with complete solution that might help me and help others,
Of
course i got some idea from other blogs.
Let's
start talking about the Solution:
Next steps? or a link to source code please.
ReplyDeleteSorry there is no code or blog , you can search for repository pattern in .net
Delete