Closed GianlucaGrotto closed 1 year ago
ScaffoldDbContext is for EF Core, and this provider is for EF 6 Classic. You should be able to use the EF6 Entity Data Model tooling to create a model from the database, but it is not something I have tried/tested.
You might need to add a .NET Framework project to your solution to do this.
so I could create a model with .net framework and then port it on .net6, isnt't it?
Yeah, it is a little complex, I think you can create a model with the "EntityFramwork.SqlServerCompact" package in a .NET Framework project, and then copy/share the generated files. Use "Code First from Database". You may also have to install SQLite Toolbox to get the DDEX provider (SQL Server Compact Simple by ErikEJ)
Thank you very much for your kind support!
@GianlucaGrotto You are very welcome. Not many users of SQL Server Compact now.
If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship
sure
Just updated the package btw, it was broken
ok thks
Dear Erik, I have installed this package 'ErikEJ.EntityFramework.SqlServerCompact' in my VS2022 C# project in .NET6. I tryed to generate the ef model with this command:
Scaffold-DbContext -Connection "Data Source= C:\temp\TestModelEFCore\TestModelEFCore\dbsqlcompact\gsdata.sdf;" -Provider ErikEJ.EntityFramework.SqlServerCompact -OutputDir dbsqlcompact/Entities -ContextDir DatabaseModel -Context MyContext -UseDatabaseNames -f -Verbose
what I've received is the message above. what can I do is it possible to generate the model?
thank you very much Gianluca