Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have an class model with some properties and need to add piece of code in set section :
C#
class person
{
    string _name;
    public string Name
    {
        get
        {
            return _name;
            // code
        }
        set
        {
            _name = value;
            //adding here
        }
    }

    // other properties
}

how i can do it with t4 template
?
Posted

1 solution

Install Visual Studio Extension tangible T4 Editor to edit or create T4 file and to generate POCO classes
https://visualstudiogallery.msdn.microsoft.com/b0e2dde6-5408-42c2-bc92-ac36942bbee9[^]

Also, follow this link on how to write T4 text templates:
https://msdn.microsoft.com/en-us/library/bb126478.aspx[^]
 
Share this answer
 
Comments
BillWoodruff 2-Oct-15 21:10pm    
The OP is asking how to edit an existing Class.
Sreekanth Mothukuru 5-Oct-15 21:15pm    
The links I provided also suggest on how to edit existing cs/ model class files being generated using T4 template.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900