Sixth Step Now we need to test our application. The services are registered ConfigureServices and consumed throughout the application through dependency injection (di) or ApplicationServices.įifth Step Let´s create the controllers, Cartegor圜ontroller and CourseController. Now let´s create the class DataContext for we work with Entity Framework Core, so write the terminal console VSCode this command for add package EF in memory run dotnet add package, as in the image below.įourth Step: Let´s configure the Startup class for we need to say for our application, that we are work with Entity Framework and configure. DataContext - for to work EntityFrameworkCore and We will using database in memory.How you can see in the image below, we will use the validation in properties using DataAnnotations in fields. We will create the classes Category and Course. Lets to create the folder: Model and Data. Now we let´s create some folders and classes. Delete the files WeatherForecast.cs and WeatherForecastController.cs. Third step: Open the Visual Studio Code and select your directory, the directory where we created the project Web API. Where the syntax -o is used for creating the directory for your project. Second step: Write in the Power Shell the command dotnet new webapi -o CourseApi. NET 3.0.įirst step: First of all, before installing the VSCode open the Windows Power Shell and select your directory, the directory where you will create this project API. In this case, I'm using de NET version 5.0 but you can use the version. For this, you need to install VSCode at this link. In this article, I will teach how to create API using Visual Studio Code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |