Follow up for https://github.com/dotnet/razor/pull/12614, see this comment in particular: https://github.com/dotnet/razor/pull/12614#discussion_r2662924480 Now that the bug is fixed and we have tests etc. lets review the APIs we have and see if there is some simplifications possible, as Todd suggested.