How to add additional function to tt template in entity framework?

84 views Asked by At

I have default generated .tt template without any edits and so default generated entities. I want to override toString() method for all my entities to build big string with all properties' names and values. It'll look like this:

toString(){ return nameof(prop1)=prop1?.toString() ?? string.Empty + ";" + nameof(prop2)=prop2...}

Where and what I need to add in template file? P.S. You can offer better/another syntax if it will be the same result

0

There are 0 answers