https://dotnet.microsoft.com/en-us/download/dotnet/6.0
dotnet --version
run it once to make it global it is for Entity Framework Core Entity Framework and Connecting to MySQL
dotnet tool install --global dotnet-ef
dotnet tool install --global dotnet-ef --version 8.\*
mkdir FirstCSharp
cd FirstCSharp
dotnet new console
One line (-o creates the folder for you if the folder name does not already exist):
dotnet new console -o FirstCSharp
dotnet run
using System;
namespace FirstCSharp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
dotnet new web --no-https -o ProjectName
dotnet run
dotnet watch run
dotnet new mvc --no-https -o ProjectName
dotnet restore
will be in ProjectName.csproj
file
dotnet add package Pomelo.EntityFrameworkCore.MySql --version 6.0.1
dotnet add package Microsoft.EntityFrameworkCore.Design --version 6.0.3
needed just ones for connected to DB
dotnet ef migrations add FirstMigration
or
dotnet ef migrations add FirstMigration -v
to remove the migration
dotnet ef migrations remove
it can be reuse for the code
dotnet ef database update
dotnew have many templete as
dotnet new console
dotnet new web
dotnet new mvc
dotnet new webapp
dotnet new webapi
- ...
Another key difference between ASP.NET and .NET is the programming language used for development. While ASP.NET is developed using C#, .NET is developed using multiple languages, such as C#, Visual Basic, and F#. This makes .NET more versatile and allows developers to choose a language that works best for their project.