Adding Database Model (Database First Approach) in .NET Core class Library

.net-core-class-library asp.net-core entity-framework-core

Question

I am adding Data Model (Database First Approach) in .NET Core Class Library using Entity FrameWorkCore.

I have added all necessary packages and when I try to create the model using below command using PMC I am receiving below message:

"No project was found. Change the current working directory or use the --project option."

Command in PMC (using Core Class library):

dotnet ef dbcontext Scaffold "Server=XXX;Database=EFCore;User Id=XX;Password=XX;" Microsoft.EntityFrameworkCore.SqlServer -o Models
1
0
10/24/2019 5:29:00 PM

Popular Answer

Try this example:

Scaffold-DbContext "DataSource=D:\Database\SQLite\Example.sqlite" Microsoft.EntityFrameworkCore.Sqlite -OutputDir Model

Tutorial

0
11/22/2019 10:58:00 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow