Browse Source

Created ExceptionSubscriber.

pull/3334/head
Halil İbrahim Kalkan 7 years ago
parent
commit
91226ece1b
  1. 4
      framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposedServiceExplorer.cs
  2. 11
      framework/src/Volo.Abp.Core/Volo/Abp/ExceptionHandling/ExceptionSubscriber.cs

4
framework/src/Volo.Abp.Core/Volo/Abp/DependencyInjection/ExposedServiceExplorer.cs

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection;
namespace Volo.Abp.DependencyInjection namespace Volo.Abp.DependencyInjection
{ {
@ -17,10 +16,11 @@ namespace Volo.Abp.DependencyInjection
public static List<Type> GetExposedServices(Type type) public static List<Type> GetExposedServices(Type type)
{ {
return type return type
.GetCustomAttributes() .GetCustomAttributes(true)
.OfType<IExposedServiceTypesProvider>() .OfType<IExposedServiceTypesProvider>()
.DefaultIfEmpty(DefaultExposeServicesAttribute) .DefaultIfEmpty(DefaultExposeServicesAttribute)
.SelectMany(p => p.GetExposedServiceTypes(type)) .SelectMany(p => p.GetExposedServiceTypes(type))
.Distinct()
.ToList(); .ToList();
} }
} }

11
framework/src/Volo.Abp.Core/Volo/Abp/ExceptionHandling/ExceptionSubscriber.cs

@ -0,0 +1,11 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace Volo.Abp.ExceptionHandling
{
[ExposeServices(typeof(IExceptionSubscriber))]
public abstract class ExceptionSubscriber : IExceptionSubscriber, ITransientDependency
{
public abstract Task HandleAsync(ExceptionNotificationContext context);
}
}
Loading…
Cancel
Save