Skip to content

Add minimal option to webapi template (#36068) #36241

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

Merged
merged 1 commit into from
Sep 7, 2021
Merged

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
2 participants