ASP.NET Core 6 Web API CRUD operations in Azure SQL Server

preview_player
Показать описание
2. Create Azure SQL Server and populate data with SQL management studio.
4. Deploying and testing the web api in Azure Web App

Resources:
PM command line:
Scaffold-DbContext "Server={server name}; Database={database name}; User ID={user name}, Password={password}; Trusted_Connection=False;Encrypt=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

T-SQL:
CREATE TABLE Employees
(
ID int primary key identity,
FirstName nvarchar(50),
LastName nvarchar(50),
Gender nvarchar(50),
Salary int
)
GO
INSERT INTO Employees VALUES ('Pranaya', 'Rout', 'Male', 60000)
INSERT INTO Employees VALUES ('Anurag', 'Mohanty', 'Male', 45000)
INSERT INTO Employees VALUES ('Preety', 'Tiwari', 'Female', 45000)
INSERT INTO Employees VALUES ('Sambit', 'Mohanty', 'Male', 70000)
INSERT INTO Employees VALUES ('Shushanta', 'Jena', 'Male', 45000)
INSERT INTO Employees VALUES ('Priyanka', 'Dewangan', 'Female', 30000)
INSERT INTO Employees VALUES ('Sandeep', 'Kiran', 'Male', 45000)
INSERT INTO Employees VALUES('Shudhansshu', 'Nayak', 'Male', 30000)
INSERT INTO Employees VALUES ('Hina', 'Sharma', 'Female', 35000)
INSERT INTO Employees VALUES ('Preetiranjan', 'Sahoo', 'Male', 80000)
GO

select * from Employees
Рекомендации по теме
Комментарии
Автор

I did everything the same way, can I add Swagger so that it works in Azure Cloud as well?

szymonduda
Автор

it showing like this "Scaffold-DbContext : The term 'Scaffold-DbContext' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again." what can i do

seshanthseshu