DEV Community

Discussion on: How to make an API with dotnet core

Collapse
 
katnel20 profile image
Katie Nelson

I used VS Code. Why, is there a difference?

Thread Thread
 
dayvster profile image
Dayvster šŸŒŠ

Not really but I was gonna recommend simply creating the web API project via Visual Studio 2019, since visual studio will template it for you.

Or alternatively using the visual studio 2019 create conroller function, which will create a controller skeleton for you

Odd that the dotnet new webapi did not correctly create your project template.

perhaps if you were to install
dotnet tool install --global dotnet-aspnet-codegenerator

via powershell, more info on that available here and here

Thread Thread
 
katnel20 profile image
Katie Nelson

In the future, I'll probably scaffold using VS2019. I only did it through the command line to follow the post.

I think I got different results because I'm using a newer version of .NET Core. There is so much stuff here to learn šŸ˜„

Thread Thread
 
dayvster profile image
Dayvster šŸŒŠ

Could be, I can't say I tried the dotnet new command yet on .NET Core 3.0.

If you'd like I could give it a test at home and let you know my results.

Thread Thread
 
katnel20 profile image
Katie Nelson

Oh, that's so sweet of you, but it's not really necessary, I've got the gist of what's going on with this. I need to concentrate on building this API for our project. Now at least the structure of how to do it is put together. I'm adjusting things to run async for the rest of the methods.

Thread Thread
 
dayvster profile image
Dayvster šŸŒŠ

Well happy developing!