SaaS CMS has officially launched! Learn more now.

Class ApprovalRepositoryExtensions

Extension method class for IApprovalRepository

Inheritance
System.Object
ApprovalRepositoryExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Approvals
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public static class ApprovalRepositoryExtensions

Methods

DeleteAsync(IApprovalRepository, Int32)

Deletes an approval instance.

Declaration
public static Task DeleteAsync(this IApprovalRepository repository, int id)
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

System.Int32 id

The identifier of the approval instance

Returns
Type Description
System.Threading.Tasks.Task

GetAsync(IApprovalRepository, Int32)

Gets an approval instance by using id.

Declaration
public static Task<Approval> GetAsync(this IApprovalRepository repository, int id)
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

System.Int32 id

The identifier of the approval instance

Returns
Type Description
System.Threading.Tasks.Task<Approval>

An approval instance

GetAsync(IApprovalRepository, Uri)

Gets an approval instance by using approval reference.

Declaration
public static Task<Approval> GetAsync(this IApprovalRepository repository, Uri reference)
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

System.Uri reference

Approval reference

Returns
Type Description
System.Threading.Tasks.Task<Approval>

An approval instance

ListAsync(IApprovalRepository, ApprovalQuery)

Get a filtered list of approval instances.

Declaration
public static Task<IEnumerable<Approval>> ListAsync(this IApprovalRepository repository, ApprovalQuery query)
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

ApprovalQuery query

Query information

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Approval>>

List of approval instances

ListAsync<T>(IApprovalRepository, ApprovalQuery)

Get a filtered list of approval instances.

Declaration
public static Task<IEnumerable<T>> ListAsync<T>(this IApprovalRepository repository, ApprovalQuery query)
    where T : Approval
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

ApprovalQuery query

Query information

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<T>>

List of approval instances

Type Parameters
Name Description
T

Type of approval

ListDecisionsAsync(IApprovalRepository, Int32)

Gets a list of step decisions for an approval instance.

Declaration
public static Task<IEnumerable<ApprovalStepDecision>> ListDecisionsAsync(this IApprovalRepository repository, int id)
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

System.Int32 id

An approval instance id

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ApprovalStepDecision>>

A list of step decisions

SaveAsync(IApprovalRepository, Approval, String)

Saves an approval instance.

Declaration
public static Task SaveAsync(this IApprovalRepository repository, Approval approval, string username)
Parameters
Type Name Description
IApprovalRepository repository

The approval repository that is being extended

Approval approval

An approval instance

System.String username

The user who saved the approval

Returns
Type Description
System.Threading.Tasks.Task

The identifier of the approval intance

Exceptions
Type Condition
ApprovalFormatException

The format of the approval is invalid