This commit adds a TypeReference implementation that is suitable for creating a reference to generated code. Closes gh-28148