Skip to content

Commit

Permalink
Update embedded resource sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lecaillon committed Feb 23, 2019
1 parent fc84341 commit 390c47e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
Binary file removed logo128.png
Binary file not shown.
2 changes: 1 addition & 1 deletion samples/AspNetCoreSample_Evolve/AspNetCoreSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Evolve" Version="2.0.0" />
<PackageReference Include="Evolve" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.2" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Evolve" Version="2.0.0" />
<PackageReference Include="Evolve" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.2" />
</ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions samples/AspNetCoreSample_Evolve_EmbeddedResources/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

private void MigrateDatabase()
{
string filters = Env.IsProduction() || Env.IsStaging() // exclude db/datasets from production environment
string filter = Env.IsProduction() || Env.IsStaging() // exclude db/datasets from production environment
? "AspNetCoreSample3.db.migrations"
: "AspNetCoreSample3.db.";
: "AspNetCoreSample3.db";

try
{
var cnx = new SqliteConnection(Configuration.GetConnectionString("MyDatabase"));
var evolve = new Evolve.Evolve(cnx, msg => _logger.LogInformation(msg))
{
// TODO: use Evolve 2.1 embedded resource feature
EmbeddedResourceAssemblies = new[] { typeof(Startup).Assembly },
EmbeddedResourceFilters = new[] { filter },
IsEraseDisabled = true,
Placeholders = new Dictionary<string, string>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"Default": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"ConnectionStrings": {
"MyDatabase": "Data Source=C:\\Windows\\Temp\\mydb.db;"
}
}
2 changes: 1 addition & 1 deletion samples/AspNetCoreSample_MSBuild/AspNetCoreSample2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Evolve.MSBuild.Windows.x64" Version="2.0.0">
<PackageReference Include="Evolve.MSBuild.Windows.x64" Version="2.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 390c47e

Please sign in to comment.