Trace the source that triggered the event

Andrej 221 Reputation points
2021-10-07T13:04:21.487+00:00

Hello, I have an Asp.Net Core Web API, witch CQRS(we use MediatR). How, for debugging purposes, define the source(ClassName, MethodName) that triggered the event. Because one handler can be used in several places and this makes debugging more difficult.
For example:

public class SomeClass
{
   public void Method1()
   {
       //..do something
       AddEvent(new **MyEvent**());
   }

   public void Method2()
   {
       //..do something
       AddEvent(new **MyEvent**());
   }
}
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,194 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,286 questions
{count} votes