November Happy Hour will be moved to Thursday December 5th.

Interface IChangeLog

Interface representing a change log

Namespace: EPiServer.ChangeLog
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public interface IChangeLog

Methods

GetChangeCount(ChangeLogQueryInfo)

Gets a count of change logs based on the criteria passed

Declaration
long GetChangeCount(ChangeLogQueryInfo queryInfo)
Parameters
Type Name Description
ChangeLogQueryInfo queryInfo
Returns
Type Description
System.Int64

An System.Int64 value with the number of logs found

Examples
  One way to use the GetChangeCount method.
        public long GetNumberOfDeletesFromUser(IChangeLog changeLog, string userName)
{
// Get the number of page deletes for specified user.
ChangeLogQueryInfo query = new ChangeLogQueryInfo();
query.ChangedBy = userName;
query.Category = (int)EPiServer.ChangeLog.ChangeLogCategory.Content;
query.Action = (int)EPiServer.ChangeLog.ChangeLogContent.ActionType.Delete;

return changeLog.GetChangeCount(query);
}

GetChangeCountBackwards(ChangeLogQueryInfo)

Gets the number of rows backwards not shown from the query.Used in button enable and disable funcionality

Declaration
long GetChangeCountBackwards(ChangeLogQueryInfo queryInfo)
Parameters
Type Name Description
ChangeLogQueryInfo queryInfo
Returns
Type Description
System.Int64

AnSystem.Int64 number of rows

GetChangeCountForward(ChangeLogQueryInfo)

Gets the number of rows forward not shown from the query.Used in button enable and disable funcionality

Declaration
long GetChangeCountForward(ChangeLogQueryInfo queryInfo)
Parameters
Type Name Description
ChangeLogQueryInfo queryInfo
Returns
Type Description
System.Int64

AnSystem.Int64 number of rows

GetChanges(ChangeLogQueryInfo, ReadDirection, SortOrder)

Retrieves a list of IChangeLogItem items based on the criteria passed

Declaration
IList<IChangeLogItem> GetChanges(ChangeLogQueryInfo queryInfo, ReadDirection direction, SortOrder order)
Parameters
Type Name Description
ChangeLogQueryInfo queryInfo

The information required to filter the query

ReadDirection direction

The direction the query should be performed in

SortOrder order

The order the data should be returned in

Returns
Type Description
System.Collections.Generic.IList<IChangeLogItem>

An System.Collections.Generic.IList<T> of IChangeLogItem items.

Examples
  One way to use the GetChanges method.
        public IList<IChangeLogItem> GetPageSaveLogs(IChangeLog changeLog)
{
// Get the last 50 page save logs
ChangeLogQueryInfo query = new ChangeLogQueryInfo();
query.MaxRecordsToReturn = 50;
query.Category = (int)EPiServer.ChangeLog.ChangeLogCategory.Content;
query.Action = (int)EPiServer.ChangeLog.ChangeLogContent.ActionType.Save;

return changeLog.GetChanges(query, ReadDirection.Backwards, SortOrder.Ascending);
}

GetHighestSequenceNumber()

Gets the highest sequence number in use in the change log

Declaration
long GetHighestSequenceNumber()
Returns
Type Description
System.Int64

An System.Int64 value representing the highest sequence number used

Save(IChangeLogItem)

Saves the IChangeLogItem item

Declaration
void Save(IChangeLogItem item)
Parameters
Type Name Description
IChangeLogItem item

The item to save

Save(IEnumerable<IChangeLogItem>)

Saves the IChangeLogItem instances in the collection

Declaration
void Save(IEnumerable<IChangeLogItem> items)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IChangeLogItem> items

A collection of IChangeLogItem items

Truncate(Int64, DateTime)

Truncate entries from the change log

Declaration
void Truncate(long rows, DateTime olderThan)
Parameters
Type Name Description
System.Int64 rows

The number of rows to truncate

System.DateTime olderThan

The date for which rows older than should be deleted

TruncateByDependency(DateTime)

Truncate entries from the change log based on the dependecies registered with the ChangeLogSystem class. The default date of the oldest item to preserve in the change log.

Declaration
void TruncateByDependency(DateTime defaultOldestChangeDate)
Parameters
Type Name Description
System.DateTime defaultOldestChangeDate

Extension Methods