-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calculated parameters #905
Comments
Hi @lucamorelli I'm not really following the scenario. Can you be more specific? |
if I need to add a condition like this how can I express it in a more concise way ? |
I'm not sure if this is what you are looking for so let me know if it's not. If you need to use a condition in several places I believe that a After creating that computed symbol you can use that in your
Example here Instead of
|
thanks, looks like it's what I was looking for. Can you add a sample about this in the samples repo? I looked for something similar, but I haven't found anything similar neither in the sample repo nor in the main branch of this repo |
I created dotnet/dotnet-template-samples#19 to track creating a sample for this. |
reading the https://blogs.msdn.microsoft.com/dotnet/2017/04/02/how-to-create-your-own-templates-for-dotnet-new/ I read this:
The expression used in the condition here, (EnableContentPage), is very basic but, you can create more complex conditions using operators such as &&,||,!,<,>=,etc. For more info see https://aka.ms/dotnetnew-template-config.
Looks like that I can create a complex condition inside the template, but since sometimes the expressions can be complicated and must replicated in more places in the template files, I would like to know if is possibile to move the definition and evalution of the expression outside the files itself in a single place.
I looked to the documentation and I don't understand if is possible: the more simple idea I have is to create some kind of parameter as a calculated field based on other paramters and conditions, and use this directly in the template files.
The text was updated successfully, but these errors were encountered: