Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Dynamically add interfaces using T4 Template

$
0
0

Hi,

I have a T4 template and need to add interfaces to a class depending on the parameters that have been set.

<#@ parameter name="ClassName" type="System.String" #>
<#@ parameter name="IncludeSave" type="System.Boolean" #>
<#@ parameter name="IncludeDelete" type="System.Boolean" #>
<#@ parameter name="IncludeRetrieve" type="System.Boolean" #>

public class <#= this.ClassName #> : IRetrieveOperation, ISaveOperation, IDeleteOperation

I would like to only add the IRetrieveOperation interface if IncludeRetrieve is set to true, and similarly for ISaveOperation and IDeleteOperation.

Does anyone know how this would be achieved?

Thanks heaps.


Viewing all articles
Browse latest Browse all 4410


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>