Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Visual Studio Code, DotNetCore with EF ====== <code> On VSCode Open Folder. ( make directory, or something ) Menu; View -> Terminal On Terminal > dotnet new mvc > dotnet add package Microsoft.EntityFrameworkCore.SqlServer > dotnet add package --version 1.1.0-msbuild3-final Microsoft.EntityFrameworkCore.Tools > dotnet restore cf.) > dotnet tool update > dotnet ef dbcontext scaffold "Server=192.168.0.48,61051;Database=ievent;User Id=billpower;Password=em@123!" Microsoft.EntityFrameworkCore.SqlServer -o Models Step 1. Install The Below Packages Microsoft.EntityFramworkCore Microsoft.EntityFramworkCore.SqlServer Microsoft.EntityFramworkCore.SqlServer.Design Microsoft.EntityFramworkCore.Tools.DotNet Step 2. Add this in .csproj <ItemGroup><DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /></ItemGroup> Step 3. Run the below commands in developer cmd prompt dotnet ef dbcontext scaffold "Server=.\sqlexpress;Database=EISDB;Trusted_Connecton=True;" Microsoft.EntityFrameworkCore.SqlServer -o Models dotnet ef dbcontext scaffold "Server=.\sqlexpress;Database=EISDB;Trusted_Connecton=True;" Microsoft.EntityFrameworkCore.SqlServer -o Models -f //force to update The Visual Studio Code Command Line Options - https://code.visualstudio.com/docs/editor/command-line EF Core tools reference (.NET CLI) - EF Core | Microsoft Docs - https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet Code First Getting Started With Entity Framework Core - ASP.NET Core | Learn Entity Framework Core - https://www.learnentityframeworkcore.com/walkthroughs/aspnetcore-application Data First ASP.NET Core Log In and Log Out - https://www.tutorialspoint.com/asp.net_core/asp.net_core_log_in_and_log_out.htm </code> public/computer/vscode_dotnetcore_with_ef.txt Last modified: 2021/03/05 18:19by alex