01 - Use .NET CLI to check for dotnet EF tool => dotnet ef 02 - Install DotNet EntityFramwork Globally => dotnet tool install --global dotnet-ef 03 - Update dotnet ef tool (if already installed) => dotnet tool update --global dotnet-ef 04 - Adding Conniction String in Json File : "ConnectionStrings": { "DefaultConnection": "Server=;Database=;Trusted_Connection=True;MultipleActiveResultSets=True;TrustServerCertificate=True" }, - Trusted_Connection=True Windows Auth => Auth Type if true is Windows if false we need to add User ID and Password. - TrustServerCertificate=True Only in case we use self-signed certificates, not recommended for Prodaction. - MultipleActiveResultSets=true Allows Us to make more than one Query from one instence Asyncronises. 05 - Add NuGet Pakeges to the API Project => - Microsoft.EntityFrameworkCore - Microsoft.EntityFrameworkCore.SqlServer - Microsoft.EntityFrameworkCore.Tools 06 - Scaffold-DbContext Name=DefaultConnection Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entites2 Adding DataAnnotations : Scaffold-DbContext Name=DefaultConnection Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entites -DataAnnotations Update DataBase : Scaffold-DbContext Name=DefaultConnection Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entites -DataAnnotations -force Update Only Spisific Table : Scaffold-DbContext Name=DefaultConnection Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entites -DataAnnotations -table Currencies -force 07 - Scaffold-DbContext Name=DefaultConnection Microsoft.EntityFrameworkCore.SqlServer -ContextDir Data -ContextNamespace MarketApp.Backend -OutputDir Entities2 -Namespace MarketApp.Shered 07 - On Program.cs Class Add Servise To DI services Container => - string? DBConnictionString = builder.Configuration.GetConnectionString("DefaultConnection"); - builder.Services.AddDbContext(opt => opt.UseSqlServer(DBConnictionString)); dotnet ef dbcontext scaffold "Server=161.97.127.194;Database=MauthuqWalletDB;User Id=swapLY;Password=E3A52s6scvdswe3L3TsP;Encrypt=True;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer --output-dir Models --force