Skip to content

Commit 5215958

Browse files
committed
fix(target-version) fix handling of target version
1 parent 8688020 commit 5215958

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/Output/DataContext/AppDbContext.base.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class AppDbContext : IAppDbContext, IDisposable
6060
public AppDbContext(IConfiguration configuration, IOptions<AppDbContextOptions> options)
6161
{
6262
Options = options.Value;
63-
Connection = new SqlConnection(configuration.GetConnectionString("DefaultConnection"));
63+
Connection = new SqlConnection(configuration.GetConnectionString("<spocr>DefaultConnection</spocr>"));
6464
Transactions = new List<SqlTransaction>();
6565
}
6666

src/Services/OutputService.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ public OutputService(FileManager<ConfigurationModel> configFile, IReportService
2424

2525
public DirectoryInfo GetOutputRootDir()
2626
{
27-
switch (_configFile.Config.TargetFramework)
28-
{
29-
case "net5.0":
30-
return new DirectoryInfo(Path.Combine(DirectoryUtils.GetApplicationRoot(), "Output-v5-0"));
31-
default:
32-
return new DirectoryInfo(Path.Combine(DirectoryUtils.GetApplicationRoot(), "Output"));
33-
}
27+
int.TryParse(_configFile.Config.TargetFramework?.Replace("net", "")[0].ToString(), out var versionNumber);
28+
29+
var isVersionMinNet5 = versionNumber >= 5;
30+
31+
if (versionNumber >= 5)
32+
return new DirectoryInfo(Path.Combine(DirectoryUtils.GetApplicationRoot(), "Output-v5-0"));
33+
else
34+
return new DirectoryInfo(Path.Combine(DirectoryUtils.GetApplicationRoot(), "Output"));
3435
}
3536

3637
public void GenerateCodeBase(OutputModel output, bool dryrun)

src/SpocR.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup Label="Build">
4-
<Version>3.1.10</Version>
4+
<Version>3.1.11</Version>
55
<TargetFramework>net5.0</TargetFramework>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)