filmov
tv
Bind radio button list using entity framework in ASP.NET Core using Visual Studio 2022 | Part 9

Показать описание
Bind radio button list using entity framework in ASP.NET Core using Visual studio 2022:
Requirement: SQL server 2012, Visual studio 2022
SQL table:
CREATE TABLE LanguageMaster (
LanguageId INT PRIMARY KEY,
LanguageName NVARCHAR(100) NOT NULL
);
Step:1
Installation Required through NuGet packages
1) Microsoft.EntityFrameworkCore.SqlServer
3) Microsoft.Extensions.Configuration
Step:2
Create a folder Models then Create a Class through the command line of Nuget Package:
Scaffold-DbContext "Server=DESKTOP-HSSNFCU;Database=Sample_db;Trusted_Connection=True; TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
-force
Step:3
// add db context to the container
Step 4: create a view model
public class languageViewModel
{}
Step:5
Need to added the Razor pages:
.cshtml page
Requirement: SQL server 2012, Visual studio 2022
SQL table:
CREATE TABLE LanguageMaster (
LanguageId INT PRIMARY KEY,
LanguageName NVARCHAR(100) NOT NULL
);
Step:1
Installation Required through NuGet packages
1) Microsoft.EntityFrameworkCore.SqlServer
3) Microsoft.Extensions.Configuration
Step:2
Create a folder Models then Create a Class through the command line of Nuget Package:
Scaffold-DbContext "Server=DESKTOP-HSSNFCU;Database=Sample_db;Trusted_Connection=True; TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
-force
Step:3
// add db context to the container
Step 4: create a view model
public class languageViewModel
{}
Step:5
Need to added the Razor pages:
.cshtml page