In this post we will discuss about how to create a list using SharePoint 2010 server object model.
Here is the code to create a SharePoint list by using SharePoint 2010 server object model.
SPWeb site = SPContext.Current.Web;
string ListTitle = "Our List Name";
string ListDescription = "This is our description for our list";
Guid ListId = site.Lists.Add(ListTitle, ListDescription,
SPListTemplateType.Contacts); //We are using Contacts list template for our list.
SPList list = site.Lists[ListId];
list.OnQuickLaunch = true; // This is to show the list in the quick launch bar.
list.Update();