Show / Hide Table of Contents

    Class AuditService

    Inheritance
    System.​Object
    Repository​Service
    Scope​Repository​Service
    Namespace:System.Dynamic.ExpandoObject
    Assembly:Umbraco.Core.dll
    Syntax
    public sealed class AuditService : ScopeRepositoryService, IAuditService, IService

    Constructors

    AuditService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IEventMessagesFactory)

    Declaration
    public AuditService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory)
    Parameters
    Type Name Description
    IDatabase​Unit​Of​Work​Provider provider
    Repository​Factory repositoryFactory
    ILogger logger
    IEvent​Messages​Factory eventMessagesFactory

    Methods

    Add(AuditType, String, Int32, Int32)

    Declaration
    public void Add(AuditType type, string comment, int userId, int objectId)
    Parameters
    Type Name Description
    Audit​Type type
    System.​String comment
    System.​Int32 userId
    System.​Int32 objectId

    GetPagedItemsByEntity(Int32, Int64, Int32, out Int64, Direction, AuditType[], IQuery<IAuditItem>)

    Returns paged items in the audit trail for a given entity

    Declaration
    public IEnumerable<IAuditItem> GetPagedItemsByEntity(int entityId, long pageIndex, int pageSize, out long totalRecords, Direction orderDirection = Direction.Descending, AuditType[] auditTypeFilter = null, IQuery<IAuditItem> customFilter = null)
    Parameters
    Type Name Description
    System.​Int32 entityId
    System.​Int64 pageIndex
    System.​Int32 pageSize
    System.​Int64 totalRecords
    Direction orderDirection

    By default this will always be ordered descending (newest first)

    Audit​Type[] auditTypeFilter

    Since we currently do not have enum support with our expression parser, we cannot query on AuditType in the query or the custom filter so we need to do that here

    IQuery<IAudit​Item> customFilter

    Optional filter to be applied

    Returns
    Type Description
    System.​Collections.​Generic.​IEnumerable<IAudit​Item>

    GetPagedItemsByUser(Int32, Int64, Int32, out Int64, Direction, AuditType[], IQuery<IAuditItem>)

    Returns paged items in the audit trail for a given user

    Declaration
    public IEnumerable<IAuditItem> GetPagedItemsByUser(int userId, long pageIndex, int pageSize, out long totalRecords, Direction orderDirection = Direction.Descending, AuditType[] auditTypeFilter = null, IQuery<IAuditItem> customFilter = null)
    Parameters
    Type Name Description
    System.​Int32 userId
    System.​Int64 pageIndex
    System.​Int32 pageSize
    System.​Int64 totalRecords
    Direction orderDirection

    By default this will always be ordered descending (newest first)

    Audit​Type[] auditTypeFilter

    Since we currently do not have enum support with our expression parser, we cannot query on AuditType in the query or the custom filter so we need to do that here

    IQuery<IAudit​Item> customFilter

    Optional filter to be applied

    Returns
    Type Description
    System.​Collections.​Generic.​IEnumerable<IAudit​Item>

    Write(Int32, String, String, DateTime, Int32, String, String, String)

    Writes an audit entry for an audited event.

    Declaration
    public IAuditEntry Write(int performingUserId, string perfomingDetails, string performingIp, DateTime eventDateUtc, int affectedUserId, string affectedDetails, string eventType, string eventDetails)
    Parameters
    Type Name Description
    System.​Int32 performingUserId

    The identifier of the user triggering the audited event.

    System.​String perfomingDetails

    Free-form details about the user triggering the audited event.

    System.​String performingIp

    The IP address or the request triggering the audited event.

    System.​Date​Time eventDateUtc

    The date and time of the audited event.

    System.​Int32 affectedUserId

    The identifier of the user affected by the audited event.

    System.​String affectedDetails

    Free-form details about the entity affected by the audited event.

    System.​String eventType

    The type of the audited event - must contain only alphanumeric chars and hyphens with forward slashes separating categories. The eventType will generally be formatted like: {application}/{entity-type}/{category}/{sub-category} Example: umbraco/user/sign-in/failed

    System.​String eventDetails

    Free-form details about the audited event.

    Returns
    Type Description
    IAudit​Entry
    In This Article
    • Constructors
      • AuditService(IDatabaseUnitOfWorkProvider, RepositoryFactory, ILogger, IEventMessagesFactory)
    • Methods
      • Add(AuditType, String, Int32, Int32)
      • GetPagedItemsByEntity(Int32, Int64, Int32, out Int64, Direction, AuditType[], IQuery<IAuditItem>)
      • GetPagedItemsByUser(Int32, Int64, Int32, out Int64, Direction, AuditType[], IQuery<IAuditItem>)
      • Write(Int32, String, String, DateTime, Int32, String, String, String)
    Back to top Copyright © 2016 Umbraco
    Generated by DocFX