Skip to content
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

fix minimal endpoints in minimal classes (w/ top level statements) #2292

Merged

Conversation

deepchoudhery
Copy link
Contributor

Program.cs or similar classes with top level statements could not be used as an endpoints class for minimal api endpoints scenario.

  • Program.cs or other (only 1 allowed currently but scaffolding does not care) can be used an endpoints class.
  • Add a new static class at the end of Program.cs instead of creating a new file for the class.
  • Add necessary usings and IEndpointRouteBuilder extension calls.

@deepchoudhery deepchoudhery merged commit d24b4f2 into main Feb 27, 2023
@deepchoudhery deepchoudhery deleted the dev/decho/fix-minimal-endpoints-in-minimal-classes branch February 27, 2023 19:39
deepchoudhery added a commit that referenced this pull request Feb 27, 2023
…2292)

* init

* file with top level statements can be used for endpoints now!

* minor fixes
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.

None yet

2 participants