Repository navigation
Expand file tree
/
Copy pathentity_framework
More file actions
45 lines (22 loc) · 1.53 KB
/
Copy pathentity_framework
File metadata and controls
45 lines (22 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
install entity framework :
dotnet tool install --global dotnet-ef
rider -> nugget, add entity frameowrk , add to this project
il faut se placer dnas le repertoire ou se toruve le fichier file.csproj.
puis executer dotnet ef dbcontext scaffold "Server=(localdb)\MSSQLLocalDB;Integrated Security=true;" Microsoft.EntityFrameworkCore.SqlServer -c AcmeDataContext
qui va généré le fichier pour nous
la database est à droite pour configuré mysql deuximeme onglet a droite
on configure mysql de rider via MySql.Data.EntityFrameworkCore
mot clés : configuration rider mysql
https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-example.html
https://blog.jetbrains.com/dotnet/2017/08/09/running-entity-framework-core-commands-rider/
edit -> ConsoleProjet.csproj :
<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.20" />
</ItemGroup>
important !
dotnet add package MySql.Data.EntityFrameworkCore --version 8.0.20
les version supérieurs ont plusieurs bug notament datetime.
la ligne de ocmmande de la connexion : dotnet ef dbcontext scaffold "server=127.0.0.1;port=3306;user=phpmyadmin;password=Password1011%;database=quiz" MySql.Data.EntityFrameworkCore -o quiz -f --verbose