@manhnguyenv

Welcome to my blog!

Creating C# Classes from SQL Tables

April 21, 2020 12:22

Creating C# Classes from SQL Tables (edit)

https://blog.bitscry.com/2020/04/02/creating-c-classes-from-sql-tables/

https://blog.bitscry.com/2020/04/07/using-odata-with-entity-framework/

https://github.com/mattosaurus/BitscryExamples

First you need to install the following 3 NuGet packages.

  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.Tools
  • Microsoft.EntityFrameworkCore.SqlServer

Scaffold-DbContext "Server=tcp:SERVER.database.windows.net,1433;Initial Catalog=DATABASE;Persist Security Info=False;User ID=USERNAME;Password=PASSWORD;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

Categories

Recent posts