[cs] Write type parameters in the correct classes: Closes #3224