• Articles
  • API Documentation
  • GitHub
  • Abhith
  • API Documentation
  • Code.Library.Application.Behaviors
  • UnhandledExceptionBehavior<TRequest, TResponse>

    Show / Hide Table of Contents
    • Code.Library
      • Breadcrumb
      • BreadcrumbNode
      • IAuditedObject
      • IAuditedObject<TUser>
      • ICreationAuditedObject
      • ICreationAuditedObject<TCreator>
      • IDeletionAuditedObject
      • IDeletionAuditedObject<TUser>
      • IHasCreationTime
      • IHasDeletionTime
      • IHasModificationTime
      • IMayHaveCreator
      • IMayHaveCreator<TCreator>
      • IModificationAuditedObject
      • IModificationAuditedObject<TUser>
      • IResult
      • ISoftDelete
      • Result
      • Result<T>
      • Result<T, E>
      • ResultFailureException
      • ResultFailureException<E>
      • ResultSuccessException
    • Code.Library.Application.Behaviors
      • LoggingBehavior<TRequest, TResponse>
      • RequestPerformanceBehavior<TRequest, TResponse>
      • UnhandledExceptionBehavior<TRequest, TResponse>
    • Code.Library.AspNetCore
      • PerfTracker
      • ServiceCollectionExtensions
    • Code.Library.AspNetCore.Attributes
      • LogUsageAttribute
    • Code.Library.AspNetCore.Extensions
      • HealthCheckEndpointRouteBuilderExtensions
      • HttpRequestExtensions
      • ILoggerExtensions
    • Code.Library.AspNetCore.Filters
      • TrackPerformanceFilter
    • Code.Library.AspNetCore.Helpers
      • SerilogHelper
    • Code.Library.AspNetCore.Middleware
      • ApiExceptionMiddleware
      • ApiExceptionMiddlewareExtensions
      • ApiExceptionOptions
      • RequestLoggingMiddlewareExtensions
    • Code.Library.AspNetCore.Middleware.RequestResponseLogging
      • ExcludeInRequestResponseLoggingOptions
      • IncludeInRequestResponseLoggingOptions
      • RequestResponseLoggingMiddleware
      • RequestResponseLoggingMiddlewareExtensions
      • RequestResponseLoggingOptions
    • Code.Library.Domain.Models
      • Enumeration
    • Code.Library.Dtos
      • AuditedEntityDto
      • AuditedEntityDto<TPrimaryKey>
      • CreationAuditedEntityDto
      • CreationAuditedEntityDto<TPrimaryKey>
      • EntityDto
      • EntityDto<TKey>
      • EntityRequestDto<TKey>
      • FullAuditedEntityDto
      • FullAuditedEntityDto<TPrimaryKey>
      • IEntityDto
      • IEntityDto<TKey>
      • IFullAuditedObject
      • IFullAuditedObject<TUser>
      • IHasTotalCount
      • ILimitedResultRequest
      • IListResult<T>
      • IPagedAndSortedResultRequest
      • IPagedResult<T>
      • IPagedResultRequest
      • ISortedResultRequest
      • LimitedResultRequestDto
      • ListResultDto<T>
      • PagedAndSortedResultRequestDto
      • PagedResultDto<T>
      • PagedResultRequestDto
    • Code.Library.Exceptions
      • DomainException
    • Code.Library.Extensions
      • DateTimeExtensions
      • FileSystemExtensions
      • GenericTypeExtensions
      • IEnumerableExtensions
      • NumberExtensions
      • ResultExtensions
      • StringExtensions
    • Code.Library.Helpers
      • DateTimeHelper
      • FileHelper
      • SerializationHelper
      • ThirdPartyHelper

    Class UnhandledExceptionBehavior<TRequest, TResponse>

    For any exception that thrown in the request pipeline, except DomainExceptions, by adding this behavior, it will log the exception.

    Inheritance
    object
    UnhandledExceptionBehavior<TRequest, TResponse>
    Implements
    IPipelineBehavior<TRequest, TResponse>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Code.Library.Application.Behaviors
    Assembly: Code.Library.Application.dll
    Syntax
    public class UnhandledExceptionBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
    Type Parameters
    Name Description
    TRequest
    TResponse
    Remarks

    Credits: https://github.com/jasontaylordev/CleanArchitecture

    Constructors

    | Improve this Doc View Source

    UnhandledExceptionBehavior(ILogger<TRequest>)

    For any exception that thrown in the request pipeline, except DomainExceptions, by adding this behavior, it will log the exception.

    Declaration
    public UnhandledExceptionBehavior(ILogger<TRequest> logger)
    Parameters
    Type Name Description
    ILogger<TRequest> logger
    Remarks

    Credits: https://github.com/jasontaylordev/CleanArchitecture

    Methods

    | Improve this Doc View Source

    Handle(TRequest, CancellationToken, RequestHandlerDelegate<TResponse>)

    For any exception that thrown in the request pipeline, except DomainExceptions, by adding this behavior, it will log the exception.

    Declaration
    public Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
    Parameters
    Type Name Description
    TRequest request
    CancellationToken cancellationToken
    RequestHandlerDelegate<TResponse> next
    Returns
    Type Description
    Task<TResponse>
    Remarks

    Credits: https://github.com/jasontaylordev/CleanArchitecture

    Implements

    MediatR.IPipelineBehavior<TRequest, TResponse>

    Extension Methods

    SerializationHelper.SerializeObject<T>(T)
    SerializationHelper.SerializeObjectUsingBinaryFormatter<T>(T)
    SerializationHelper.SerializeToXML<T>(T)
    GenericTypeExtensions.GetGenericTypeName(object)
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • UnhandledExceptionBehavior(ILogger<TRequest>)
    • Methods
      • Handle(TRequest, CancellationToken, RequestHandlerDelegate<TResponse>)
    • Implements
    • Extension Methods
    Back to top Generated by Abhith Rajan using DocFX