parent
b47b8956f2
commit
a0b861dd73
@ -0,0 +1,17 @@
|
||||
# ex_041_001_ConnectionStrings
|
||||
|
||||
Cet exemple a pour but de présenter les chaîne de connexion (*connection strings*).
|
||||
|
||||
Servent à se connecter à une base de données
|
||||
diffèrent en fonction des providers
|
||||
parfois, elles nécessitent login/pwd_
|
||||
|
||||
dans l'exemple :
|
||||
2 providers
|
||||
pour sqlite, il faut rajouter les nugets, le chemin du starting working directory
|
||||
on peut observer le contenu avec DB browser : https://sqlitebrowser.org/dl/
|
||||
|
||||
todo : faire fonctionner avec les deux providers
|
||||
préciser la différence pour les migrations
|
||||
dotnet ef migrations add ex_041_001_ConnectionStrings --context SQLiteContext
|
||||
dotnet ef database update --context SQLiteContext
|
@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<StartWorkingDirectory>$(MSBuildProjectDirectory)</StartWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in new issue