« Entity Framework Core 7 » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
(Page créée avec « Category:.NET Core = [https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli#install-entity-framework-core Install Entity Framework Core] = <kode lang='bash'> # sql server dotnet add package Microsoft.EntityFrameworkCore.SqlServer dotnet add package Microsoft.EntityFrameworkCore.Design # mysql dotnet add package Pomelo.EntityFrameworkCore.MySql dotnet add package Microsoft.EntityFrameworkCore.Design </kode> == [https://doc... ») |
|||
Ligne 18 : | Ligne 18 : | ||
|- | |- | ||
| SQL Server || Microsoft.EntityFrameworkCore.SqlServer || Server=(localdb)\\MSSQLLocalDB;Database=MyDb;Integrated Security=True;MultipleActiveResultSets=True;<br>Server=localhost;Database=MyDb;User=sa;Password=pwd; | | SQL Server || Microsoft.EntityFrameworkCore.SqlServer || Server=(localdb)\\MSSQLLocalDB;Database=MyDb;Integrated Security=True;MultipleActiveResultSets=True;<br>Server=localhost;Database=MyDb;User=sa;Password=pwd; | ||
|- | |- | ||
| MySQL / MariaDB || [https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql Pomelo.EntityFrameworkCore.MySql] || server=localhost;database=MyDb;user=root;password=pwd | | MySQL / MariaDB || [https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql Pomelo.EntityFrameworkCore.MySql] || server=localhost;database=MyDb;user=root;password=pwd | ||
Ligne 26 : | Ligne 24 : | ||
|- | |- | ||
| InMemory || [https://docs.microsoft.com/en-us/ef/core/providers/in-memory/?tabs=dotnet-core-cli Microsoft.EntityFrameworkCore.InMemory] || databaseName: "test_database" | | InMemory || [https://docs.microsoft.com/en-us/ef/core/providers/in-memory/?tabs=dotnet-core-cli Microsoft.EntityFrameworkCore.InMemory] || databaseName: "test_database" | ||
|- | |||
| Sqlite || Microsoft.EntityFrameworkCore.Sqlite || Data Source=/tmp/file.db | |||
|} | |} |
Version du 28 juin 2023 à 21:07
Install Entity Framework Core
# sql server dotnet add package Microsoft.EntityFrameworkCore.SqlServer dotnet add package Microsoft.EntityFrameworkCore.Design # mysql dotnet add package Pomelo.EntityFrameworkCore.MySql dotnet add package Microsoft.EntityFrameworkCore.Design |
Data Providers
Provider | Package NuGet | Connection String |
---|---|---|
SQL Server | Microsoft.EntityFrameworkCore.SqlServer | Server=(localdb)\\MSSQLLocalDB;Database=MyDb;Integrated Security=True;MultipleActiveResultSets=True; Server=localhost;Database=MyDb;User=sa;Password=pwd; |
MySQL / MariaDB | Pomelo.EntityFrameworkCore.MySql | server=localhost;database=MyDb;user=root;password=pwd |
PostgreSQL | Npgsql.EntityFrameworkCore.PostgreSQL | Host=localhost;Database=MyDb;Username=root;Password=pwd |
InMemory | Microsoft.EntityFrameworkCore.InMemory | databaseName: "test_database" |
Sqlite | Microsoft.EntityFrameworkCore.Sqlite | Data Source=/tmp/file.db |