Using Roslyn, how can I check the body of a method to determine whether another method is always invoked before returning? For example, in an OWIN middleware, I want to check if the next method is called in all execution paths.
try
{
await next();
}
catch
{
Console.WriteLine("Error"); // the next() is not invoked
}
or
if(condition)
return; // The next method invocation is ignored
await next();