I would imagine fixing this would mean breaking this out into two methods? https://github.com/MiniProfiler/dotnet/blob/master/src/MiniProfiler.AspNetCore.Mvc/MvcExtensions.cs#L22