GlobalExceptionHandlerDotNet icon indicating copy to clipboard operation
GlobalExceptionHandlerDotNet copied to clipboard

Is it possible to add a non-generic method of Map<T>() ?

Open eukaryoteoops opened this issue 5 years ago • 0 comments

I would like to scan the Implement classes of the interface IException that I defined to custom StatusCode in GlobalExceptionHandler, but with generic version of Map<T>(), I had to use reflection to achieve that, it's a bit of annoying... is it possible to add a non-generic version of Map<T>(), such as Map(Type t)? or add a property of StatusCode to ExceptionHandlerConfiguration?

var exceptionList = Assembly.GetExecutingAssembly().GetTypes().Where(t => t != typeof(IException) && typeof(IException).IsAssignableFrom(t)).ToList();

 foreach (var item in exceptionList)
{
/// can not use o.Map<T>() here directly.
}

eukaryoteoops avatar Feb 19 '20 05:02 eukaryoteoops