Search code examples
c#visual-studio-2012lambdavisual-studio-debugging

how to step through lambda expression


I have this little method

    [System.Diagnostics.DebuggerStepThrough]
    public static void Log(Database db)
    { 
        db.Log = s => MyLogger.Log(s);
    }

but the debugger still stop for every s => MyLogger.Log(s)

is there a way to tell the debugger to ignore this specific line?

king of boring to have to manually step to/over/out of it for each query

this db.Log thing is the entity framework 6 log


Solution

  • this does what i want;

        [System.Diagnostics.DebuggerStepThrough]
        public static void Log(Database db)
        {
            Action<string> Log = MyLogger.Log;
            db.Log = Log;
        }