Class ProjectRepository
Repository for loading and save Project and Project
Inheritance
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public abstract class ProjectRepository : Object
Constructors
ProjectRepository()
Declaration
protected ProjectRepository()
Methods
Delete(Int32)
Deletes the Project with the specified identifyer
Declaration
public abstract void Delete(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The identifier of the project that should be deleted. |
DeleteItems(IEnumerable<Int32>)
Deletes the Project
Declaration
public abstract void DeleteItems(IEnumerable<int> projectItems)
Parameters
Type | Name | Description |
---|---|---|
System. |
projectItems | A list of project item identity |
Get(Int32)
Gets a Project by it's identifier
Declaration
public abstract Project Get(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id of the project to be retrieved |
Returns
Type | Description |
---|---|
Project | The project or |
GetItem(Int32)
Load a single project item
Declaration
public abstract ProjectItem GetItem(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The project item id |
Returns
Type | Description |
---|---|
Project |
The project item or if no project item was found |
GetItems(IEnumerable<ContentReference>)
Gets all Project
Declaration
public abstract IEnumerable<ProjectItem> GetItems(IEnumerable<ContentReference> contentReferences)
Parameters
Type | Name | Description |
---|---|---|
System. |
contentReferences |
Returns
Type | Description |
---|---|
System. |
Items of Project |
Remarks
The result of the GetItems or the number of items may be different from Content
List()
Lists all Project in the repository.
Declaration
public virtual IEnumerable<Project> List()
Returns
Type | Description |
---|---|
System. |
A list of projects, if no projects was found an empty list will be returned |
List(Int32, Int32, out Int32)
Lists all Project in the repository.
Declaration
public virtual IEnumerable<Project> List(int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
System. |
startIndex | The start index, used for paging |
System. |
maxRows | The maximum number of rows returned |
System. |
totalCount | The total amount of projects |
Returns
Type | Description |
---|---|
System. |
A list of projects, if no projects was found an empty list will be returned |
List(Nullable<ProjectStatus>, Int32, Int32, out Int32)
Lists all Project in the repository with the specified status.
Declaration
public abstract IEnumerable<Project> List(Nullable<ProjectStatus> status, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
System. |
status | The status of projects to get or null to get all projects regardless of status. |
System. |
startIndex | The start index, used for paging |
System. |
maxRows | The maximum number of rows returned |
System. |
totalCount | The total amount of projects |
Returns
Type | Description |
---|---|
System. |
A list of projects, if no projects was found an empty list will be returned |
ListItems(Int32)
Gets all Project
Declaration
public virtual IEnumerable<ProjectItem> ListItems(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The project id |
Returns
Type | Description |
---|---|
System. |
A list of project items, if no project items was found an empty list will be returned |
ListItems(Int32, CultureInfo, Int32, Int32, out Int32)
Gets all Project
Declaration
public IEnumerable<ProjectItem> ListItems(int id, CultureInfo language, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The project id |
System. |
language | The language of the items to return (optional) |
System. |
startIndex | The start index, used for paging |
System. |
maxRows | The maximum number of rows returned |
System. |
totalCount | The total number of items in the set |
Returns
Type | Description |
---|---|
System. |
A list of project items, if no project items was found an empty list will be returned |
ListItems(Int32, String, CultureInfo, Int32, Int32, out Int32)
Gets all Project
Declaration
public abstract IEnumerable<ProjectItem> ListItems(int id, string category, CultureInfo language, int startIndex, int maxRows, out int totalCount)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The project id |
System. |
category | The category of the items to return (optional) |
System. |
language | The language of the items to return (optional) |
System. |
startIndex | The start index, used for paging |
System. |
maxRows | The maximum number of rows returned |
System. |
totalCount | The total number of items in the set |
Returns
Type | Description |
---|---|
System. |
A list of project items, if no project items was found an empty list will be returned |
OnProjectDeleted(ProjectEventArgs)
Raises the Project
Declaration
protected virtual void OnProjectDeleted(ProjectEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Project |
args | The Project |
OnProjectItemsDeleted(ProjectItemsEventArgs)
Raises the Project
Declaration
protected virtual void OnProjectItemsDeleted(ProjectItemsEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Project |
args | The Project |
OnProjectItemsSaved(ProjectItemsEventArgs)
Raises the Project
Declaration
protected virtual void OnProjectItemsSaved(ProjectItemsEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Project |
args | The Project |
OnProjectSaved(ProjectEventArgs)
Raises the Project
Declaration
protected virtual void OnProjectSaved(ProjectEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Project |
args | The Project |
Save(Project)
Creates or saves a Project
Declaration
public abstract void Save(Project project)
Parameters
Type | Name | Description |
---|---|---|
Project | project | The project to save |
SaveItems(IEnumerable<ProjectItem>)
Saves a list of Project
Declaration
public abstract void SaveItems(IEnumerable<ProjectItem> projectItems)
Parameters
Type | Name | Description |
---|---|---|
System. |
projectItems | A list of project items |
Remarks
Events
ProjectDeleted
Occurs when a Project has been deleted.
Declaration
public static event EventHandler<ProjectEventArgs> ProjectDeleted
Event Type
Type | Description |
---|---|
System. |
ProjectItemsDeleted
Occurs when list of Project
Declaration
public static event EventHandler<ProjectItemsEventArgs> ProjectItemsDeleted
Event Type
Type | Description |
---|---|
System. |
ProjectItemsSaved
Occurs when list of Project
Declaration
public static event EventHandler<ProjectItemsEventArgs> ProjectItemsSaved
Event Type
Type | Description |
---|---|
System. |
ProjectSaved
Occurs when a Project has been saved, i.e. created or updated.
Declaration
public static event EventHandler<ProjectEventArgs> ProjectSaved
Event Type
Type | Description |
---|---|
System. |