Please enable JavaScript.
Coggle requires JavaScript to display documents.
.NET Core 6.0 - Coggle Diagram
.NET Core 6.0
Create ASP.NET Core WebApp (MVC)
1) Models folder
Add Class
Enter code (
prop
shortcut)
Use Annotations like
Key
&
Required
Use
?
to declare as nullable field
View Image
2) Install Packages
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.SqlServer
Steps
View Image
3) Connection Strings (appsettings.json)
{"PsFK": "Data Source=htsws466\sqlexpress;Initial Catalog=PsAPI;Integrated Security=True"}
View Image
4) DBContext
Add new folder (Data)
Add a class named
(<anyname>DbContext)
using EntityFrameworkCore
View Image
5) Program.cs
View Image
6) Migration
In Package manager console
add-migration "anyname"
update database
If Changes
Bootwatch
Predefined themes of bootstrap
Download bootstrap.min.css
download and paste in it css folder
7) Add a Controller
8) Add a View
Add Razor view
Add Routing in Layout.cshtml
Concepts
constructor
getters and setters