/// <summary> /// Registers all <see cref="IExceptionHandler"/> found in the assembly <see cref="ForEvolve.ExceptionMapper"/> /// with singleton lifetime. /// </summary> public static IExceptionMappingBuilder MapCommonHttpExceptions(this IExceptionMappingBuilder builder) { return(builder.ScanHandlersFrom( s => s .FromAssembliesOf(typeof(CommonHttpExceptionHandlersMappingBuilderExtensions)) .AddClasses(x => x.InExactNamespaceOf <ConflictExceptionHandler>()), ServiceLifetime.Singleton )); }
/// <typeparam name="T">The type in which assembly that should be scanned.</typeparam> public static IExceptionMappingBuilder ScanHandlersFromAssemblyOf <T>(this IExceptionMappingBuilder builder, ServiceLifetime lifetime = ServiceLifetime.Singleton) { return(builder.ScanHandlersFrom(s => s.FromAssemblyOf <T>(), lifetime)); }