Skip to content

Conversation

@DamianEdwards
Copy link
Member

  • Add "minimal" option to webapi project template
  • Factor Program.cs into multiple files and update template manifest to exclude/rename dependent on selected options
  • Updated controller and minimal versions to set endpoint/route name when EnableOpenAPI is true
  • Configure webapi template minimal option for VS display as "Use controllers"

Fixes #35996

* Add minimal option to webapi template

- Add "minimal" option to webapi project template
- Factor Program.cs into multiple files and update template manifest to exclude/rename dependent on selected options
- Updated controller and minimal versions to set endpoint/route name when EnableOpenAPI is true
- Configure webapi template minimal option for VS display as "Use controllers"

* Update template baselines & fix casing of option description

* Fix template baseline tests issue

* Update template baseline test to be more resilient

Made the template baseline test more resilient by ensuring that all template arg options without values are added to the project key rather than a specific few. Args that have a value are still not added to the key. Keys are all tracked now to ensure uniqueness & an exception is thrown if they aren't. Renamed a few things for better clarity and easy of debugging too.

* Make template baseline test project key disregard ordering

* Update based on feedback

- Change WeatherForecast to a record
- Simplify method in test
@DamianEdwards DamianEdwards merged commit 493ed8b into main Sep 7, 2021
@DamianEdwards DamianEdwards deleted the port-36068 branch September 7, 2021 22:18
@ghost ghost added this to the 7.0-preview1 milestone Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to the Web API project template to allow the included content to use Minimal APIs instead of controllers

3 participants