Skip to content

add dotnet new templates (razor view, api controller, mvc controller) #1

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 6 commits into from
Feb 16, 2023

Conversation

deepchoudhery
Copy link
Owner

@deepchoudhery deepchoudhery commented Jan 26, 2023

added new dotnet new web item templates
Razor View:

  • added view
  • adds an empty razor view (Index.cshtml) to the project.
  • same as dotnet new page -np I guess so disregard this for now
  • Help

API Controller:

  • added apiController
  • adds an empty API Controller.
  • use --actions to add one with read/write actions.
  • Help

MVC Controller:

  • added mvcController
  • adds an empty MVC Controller.
  • use --actions to add one with read/write actions.
  • Help

@deepchoudhery deepchoudhery self-assigned this Jan 26, 2023
@deepchoudhery deepchoudhery changed the title add razor view add dotnet new templates (razor view, api controller, mvc controller) Feb 14, 2023
@vijayrkn
Copy link

@phenning - Can you please help take a look if anything stands out? These are pretty basic item templates.

@phenning
Copy link

@vijayrkn is there a specific problem, or just a general review?

@deepchoudhery I'm assuming we aren't expecting these to show up in VS right away (they won't as authored), as we need to solve the problem on how to suppress the current vstemplate versions of these templates.

@vijayrkn
Copy link

@vijayrkn is there a specific problem, or just a general review?

Just a general review.

We are not planning to ship these in VS. This is to move the templates out of the scaffolding repo. VS is already relying on the item templates that are shipped in VS.

@phenning
Copy link

@vijayrkn is there a specific problem, or just a general review?

Just a general review.

We are not planning to ship these in VS. This is to move the templates out of the scaffolding repo. VS is already relying on the item templates that are shipped in VS.

Will these ship in the SDK? I know we wouldn't have them dynamically show up in VS when they do, due to missing metadata to enable it. If we would want to invoke them from vs, we could probably figure out a way to invoke them from the vstemplate stubs instead of the content in the vstemplate. Would probably need a custom wizard, or modification of our existing vstemplate/template engine wizard to support the scenario.

@vijayrkn
Copy link

If we would want to invoke them from vs, we could probably figure out a way to invoke them from the vstemplate stubs instead of the content in the vstemplate.

For now, we have vstemplates for all of these item templates. But we can definitely consider moving to these in the future to have 1 source of truth.

@sayedihashimi
Copy link

The names apiController and mvcController should be all lower case, that is how all the other templates are defined. The other alternative is to use controller and then have a switch for mvc or api but I don't know which one of those should be the default. Maybe it's better to keep them separate like you have now.

@sayedihashimi
Copy link

I think we can delete the dotnetcli.host.json file since it only has a schema declaration. Right @phenning?

Copy link

@sayedihashimi sayedihashimi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left some comments that we should review.

@deepchoudhery deepchoudhery merged commit a337e4f into main Feb 16, 2023
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.

4 participants