public TList Create <TList>(SPWeb web, string internalName, string title, string listDesc) where TList : SPList { return(_template != null ? web.AddList <TList>(internalName, title, listDesc, _template, lst => { SetProperties(lst); AddFields(lst, FieldsAction); AddContentTypes(lst, ContentTypesAction); AddViews(lst, ViewsAction); }) : web.AddList <TList>(internalName, title, listDesc, _templateType, lst => { SetProperties(lst); AddFields(lst, FieldsAction); AddContentTypes(lst, ContentTypesAction); AddViews(lst, ViewsAction); })); }