C
C#2y ago
Indeed

Creating template with parameters on line basis

How can I create a template with parameters in my case Asp.Net Core, where some lines in certain files exist only purely based on passed parameters? Like -I true/false for Identity Server 4 and if false i shouldn't be registering the service for it in the MVC part and there shouldn't be Identity Server project? Could you point me where i can read about it?
2 Replies
Monsieur Wholesome
Parameters is a more accurate word
Indeed
Indeed2y ago
should i use
"symbols":{
"EnableContactPage":{
"type": "parameter",
"dataType":"bool",
"defaultValue": "false"
}
},
"sources": [
{
"modifiers": [
{
"condition": "(!EnableContactPage)",
"exclude": [
"Views/Home/Contact.cshtml"
]
}
]
}
]
"symbols":{
"EnableContactPage":{
"type": "parameter",
"dataType":"bool",
"defaultValue": "false"
}
},
"sources": [
{
"modifiers": [
{
"condition": "(!EnableContactPage)",
"exclude": [
"Views/Home/Contact.cshtml"
]
}
]
}
]
in some way or
"symbols":{
"AddServer": {
"type": "parameter",
"replaces":"builder.Services.Add"
},
}
"symbols":{
"AddServer": {
"type": "parameter",
"replaces":"builder.Services.Add"
},
}
and put "" to delete the line can i do
#if $$parameter$$
#if $$parameter$$
? Im just a little bit tempted to do multiple projects each for a different setup even for a few lines like this and toggle them using char option selector Bump?