Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

asp.net existing database

# tested on Visual Studio 2019
# install these packages via View>Other windows>Package Manager Console
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Design
Install-Package Microsoft.EntityFrameworkCore.Tools

# then scaffold the dbContext via your connection string
Scaffold-DbContext "Server=<serverName>"; Initial Catalog=<database>; 
  User ID=<username>; Password=<password>; Microsoft.EntityFrameworkCore.SqlServer 
  -OutputDir Models -Context CoreDbContext - DataAnnotations
 
PREVIOUS NEXT
Tagged: #existing #database
ADD COMMENT
Topic
Name
6+7 =