Это видео недоступно.
Сожалеем об этом.
Dot NET Core Web API using VS Code (Entity Framework DB First + CRUD Actions + Testing with Swagger)
HTML-код
- Опубликовано: 15 июн 2022
- #dotnetcore #webapi #entityframeworkcore #vscode #nihiratechiees
This video explains how to create Dot NET Core Web API using VS Code
Source Code
===========
github.com/nih...
Steps followed
============
1, First We need to Install .NET Core SDK Latest
2, Create Web API Using below command
dotnet new webapi
3, Run the application
dotnet run
4, Install the below extension
1, C#
2, Nuget Package manager
5, Install Entity Framework
dotnet tool install --global dotnet-ef
6, Add package Entity Framework Design
dotnet add package Microsoft.EntityFrameworkCore.Design
7, Execute the below command form verify the EF Installation
dotnet ef
8, Enter scaffold command
dotnet ef dbcontext scaffold "connectionstring" Microsoft.EntityFrameworkCore.SqlServer --output-dir Models
9, For Generating bd context only in the folder
dotnet ef dbcontext scaffold --context-dir Models
10, Create the controller also complete the steps in the middleware
but when i give command like 'dotnet new webapi' it doesn't create controller folder and files automatically
..... give me a solution
I started to create my own web api using your videos. Helps a lot. Thank you for your work🙏🧡
Glad to see👌
This is excellent. Thank you.
Welcome
Great lecture.
Thanks
Waiting for it from 2 hours. pls make a complete series on it.
👍
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SNI_PN11, error: 26 - Error Locating Server/Instance Specified)
Look like configuration issue in your database
Hello sir thank u for explain this on vscode i want ask u if u r explain controller and servics or not?
Follow this playlist it covered all
Thank you so much👍
🤝
Just after executing Dotnet run command
Localhost is not loading.
Also swagger is not loading. Follows ur steps. Pls let me know if anything need to be corrected. Also I haven't changed anything 😀after creating project. Still.
What error you are getting?
Why model folder is not created while connecting to server database
having same issue
Did you get any error message? if yes please share to my mail
i have followed just as u mentioned but when i run the command dotnet new webapi, then i am not getting controllers folder and weatherforecast.cs model
what do i do all the others were being created
I believe you chosen wrong template. Follow the steps and try again
the new version won't create controllers. you have to add option. something like: dotnet new webapi --use-controllers -n myApiname
When I run this command:
dotnet ef dbcontext scaffold "Server=localhost;Database=Learn_Db;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer --output-dir Models
I get the following:
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
Any help?
After hosting or development it self?
Development@@NihiraTechiees
how to create an edit function that edits table columns. You only create, delete, and retrieve columns.
Watch the full video create and edit also added
Hi Sir,
How can rebuild models, if any new table has been created in database.
Need to execute scaffold command it will generate the new model for newly created table
Does anyone have this error? "Failed to create CoreCLR, HRESULT: 0x80004005"
Look like dot net SDK not properly installed. Could you reinstall and try
Are you using *stored procedure* for CRUD in this app ? Please reply asap.
No. Directly dealing with table
Thanks for the video and reply❤️. If possible make video for *MVC web app with simple crud operations & stored procedure using vs code*.
Where can I get this slide.... It will be easy to copy the Commands from there
I am not maintaining slides, mostly I added all required information in the description. If any additional details needed please let me know
please sir is it the scaffold command that generated those class in Models
Yes. DB first approach scaffold will generate model class.
In code first approach we have to create model class first
can you provide database part sir
github.com/nihira2020/Database/blob/main/Learn_DB_script.sql
How to create api with code first approach then?
Check this link ruclips.net/video/K6VVCxhFVgY/видео.html
how to generate connection string ?
It's just declaration combination of servername credentials
@@NihiraTechiees , how do I get them? (I have linux)
how do i use the database you use
we don't have the same database
Check my GitHub repos i shared db script
Sir plz database part provide
Send me mail will share the database script
same here ;D
please send me database script :(((
Check my GitHub repos, name with database