question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

calculated parameters

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sayedihashimicommented, Jun 7, 2017

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 computed symbol is what you need. For example see how OrganizationalAuth is defined in here.

After creating that computed symbol you can use that in your if statements. So you can do

#if (OrganizationalAuth)
...
#endif

Example here

Instead of

#if (auth == \"SingleOrg\" || auth == \"MultiOrg\")
...
#endif
0reactions
sayedihashimicommented, Jun 23, 2017

I created https://github.com/dotnet/dotnet-template-samples/issues/19 to track creating a sample for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calculation Parameters
Parameters are named resource properties that can be used to obtain data for use by Mission Sequence commands or by output resources. Some...
Read more >
Calculated Chemistry Parameters – do they need to be ...
Calculated parameters like measured parameters are reported by laboratories and, importantly, they are also used by clinicians for clinical decisions.,, ...
Read more >
Derived and Calculated Parameters - DEXMA support
In this article you will learn about Derived and Calculated parameters. Introduction Derived parameters Create derived parameters...
Read more >
Create Parameter From Calculated Field Tableau
This Tutorial explains about Tableau Parameters: How to Create a parameter, Creation of a calculate field.
Read more >
Parameters - Looker Studio Help
Parameters serve 3 primary uses: You can use parameters in calculated fields to display results based on user input. You can pass parameters...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found