Chapter 15. Building SharePoint Lists and Libraries
In This Chapter
Comparing list definitions and instances
Getting Web parts into the action
Deploying project files to SharePoint
You've probably figured out that SharePoint is all about lists and items in those lists. Visual Studio 2010 contains two project templates specifically targeted toward creating lists in SharePoint:
SharePoint List Definition template: As the name suggests, you can use the SharePoint List Definition template to define SharePoint lists. This template is similar to a Word template. You can create a template for a SharePoint list and use it when creating new list instances.
SharePoint List Instance template: This supports a predefined list inside SharePoint.
Adding a List Definition to a Project
When you can make the Invoice document library in Chapter 14, you create an instance of the Invoice library and a content type and then associate that type with the list. If you want, you can create a list definition that already has the required content type in it. That way, you can create as many Invoice list instances on the SharePoint as you want with a single mouse click.
You can also use the List Definition from a Content Type template to solve the list creation dilemma. A Visual Studio template automatically creates a list definition from your content type.
In the following steps, you use the
Invoice content type project from the previous section and add a
List definition from a content type project item: