DataWeb
Search Results for

    Show / Hide Table of Contents

    Class AppErrorStore

    SQL Server implementation of the application error store for persisting and retrieving application errors.

    Inheritance
    object
    AppErrorStore
    Implements
    IAppErrorStore
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: DataWeb.Error.SqlServer
    Assembly: DataWeb.Data.SqlServer.dll
    Syntax
    public class AppErrorStore : IAppErrorStore
    Remarks

    Provides full CRUD operations for application error records stored in the Sys_AppErrors table. Supports filtering by error ID and message, pagination, and bulk operations.

    Constructors

    AppErrorStore(ISqlHelper, TimeProvider)

    SQL Server implementation of the application error store for persisting and retrieving application errors.

    Declaration
    public AppErrorStore(ISqlHelper sqlHelper, TimeProvider timeProvider)
    Parameters
    Type Name Description
    ISqlHelper sqlHelper
    TimeProvider timeProvider
    Remarks

    Provides full CRUD operations for application error records stored in the Sys_AppErrors table. Supports filtering by error ID and message, pagination, and bulk operations.

    Properties

    Name

    Gets the name of the data store provider.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    Methods

    GetCountAsync(CancellationToken)

    Gets the total count of application errors in the store.

    Declaration
    public Task<long> GetCountAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Cancellation token for the async operation.

    Returns
    Type Description
    Task<long>

    The total number of application error records.

    GetErrorAsync(AppErrorFilter, CancellationToken)

    Retrieves a single application error based on the provided filter criteria.

    Declaration
    public Task<AppError> GetErrorAsync(AppErrorFilter filter, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    AppErrorFilter filter

    Filter criteria including error ID and error message. Must not be null.

    CancellationToken cancellationToken

    Cancellation token for the async operation.

    Returns
    Type Description
    Task<AppError>

    An AppError object if found; otherwise null.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when filter is null.

    GetErrorsAsync(AppErrorFilter, CancellationToken)

    Retrieves a collection of application errors based on the provided filter criteria.

    Declaration
    public Task<IEnumerable<AppError>> GetErrorsAsync(AppErrorFilter filter, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    AppErrorFilter filter

    Filter criteria including count, error ID, and error message. Must not be null.

    CancellationToken cancellationToken

    Cancellation token for the async operation.

    Returns
    Type Description
    Task<IEnumerable<AppError>>

    An enumerable collection of AppError objects matching the filter criteria.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when filter is null.

    RemoveAllAsync(CancellationToken)

    Removes all application error records from the store.

    Declaration
    public Task RemoveAllAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Cancellation token for the async operation.

    Returns
    Type Description
    Task
    Remarks

    This operation cannot be undone. All error records will be permanently deleted.

    SetAsync(string, string, string, string, CancellationToken)

    Inserts a new application error record into the store.

    Declaration
    public Task SetAsync(string errorMessage, string errorStackTrace, string errorUrl, string userIdMaster, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string errorMessage

    The error message text. Must not be null or empty.

    string errorStackTrace

    The error stack trace for debugging information.

    string errorUrl

    The URL where the error occurred.

    string userIdMaster

    The ID of the user who encountered the error, if applicable.

    CancellationToken cancellationToken

    Cancellation token for the async operation.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    ArgumentException

    Thrown when errorMessage is null or empty.

    Implements

    IAppErrorStore
    In this article
    Back to top Generated by DocFX