Pomelo C# : i can't import Table without Data

448 Views Asked by At

I can't import with Pomelo on C#, a several tables without data.

Scaffold-DbContext "'Database'" Pomelo.EntityFrameworkCore.MySql" -Table  'table1' 'table2

I have an error :

sequence contains no matching element

Do you have any solution?

2

There are 2 best solutions below

1
On

Scaffolding a database and stating individual tables works fine with Pomelo 3.2.2:

CLI:

dotnet ef dbcontext scaffold "server=127.0.0.1;uid=root;pwd=;port=3306;database=So64222039" Pomelo.EntityFrameworkCore.MySql -c MyContext --verbose -t IceCreams -t IceCreamShops

Package Manager:

Scaffold-DbContext "server=127.0.0.1;uid=root;pwd=;port=3306;database=So64222039" Pomelo.EntityFrameworkCore.MySql -Context MyContext -Verbose -Tables IceCreams,IceCreamShops

The syntax to specify multiple tables is different when using the VS Package Manager instead of the CLI (use -Tables table1,table2,table3 instead of -t table1 -t table2 -t table3).

0
On

I have resolve the problem but i'm not sur it's good practice.

I import the all table with :

Scaffold-DbContext "'Database'" Pomelo.EntityFrameworkCore.MySql"

and I delete the files of others tables that I don't use.