Skip to content

Commit 86de30f

Browse files
committed
update versions
1 parent c7fd048 commit 86de30f

File tree

6 files changed

+36
-39
lines changed

6 files changed

+36
-39
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
run: |
6666
git config --global user.name "CD bot"
6767
git config --global user.email ""
68-
copy fetched/App_Data/QSOs.db HamEvent/App_Data/QSOs.db
68+
IF (Test-Path -path fetched/App_Data/QSOs.db) {copy fetched/App_Data/QSOs.db HamEvent/App_Data/QSOs.db}
6969
$NOW=& Get-Date -format yyyy-MM-dd
7070
echo "New backup done on $NOW" >> HamEvent/App_Data/dbbackup_log
7171
git add HamEvent/App_Data/QSOs.db
@@ -90,7 +90,6 @@ jobs:
9090
server-computer-name: ${{ secrets.SERVER_COMPUTER_NAME }}
9191
server-username: ${{ secrets.SERVER_USERNAME }}
9292
server-password: ${{ secrets.SERVER_PASSWORD }}
93-
target-path: '\wwwroot\'
9493
source-path: '\publish\'
9594

9695
- name: Start App Pool
@@ -101,4 +100,3 @@ jobs:
101100
server-username: ${{ secrets.SERVER_USERNAME }}
102101
server-password: ${{ secrets.SERVER_PASSWORD }}
103102

104-

HamEvent/HamEvent.csproj

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>
77
<SpaRoot>ClientApp\</SpaRoot>
@@ -11,18 +11,20 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="AutoMapper" Version="14.0.0" />
14+
<PackageReference Include="AutoMapper" Version="15.0.1" />
1515
<PackageReference Include="elmahcore" Version="2.1.2" />
16-
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="9.0.4" />
17-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
18-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.4" />
19-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.4">
16+
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="9.0.10" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.10" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.10" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.10">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>
23-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
23+
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
2424
<PackageReference Include="NReco.Logging.File" Version="1.2.2" />
25-
<PackageReference Include="Select.HtmlToPdf.NetCore" Version="25.1.0" />
25+
<PackageReference Include="Select.HtmlToPdf.NetCore" Version="25.2.0" />
26+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.10" />
27+
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
2628
</ItemGroup>
2729

2830
<ItemGroup>

HamEvent/MailerSettings.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace HamEvent
2+
{
3+
public class MailerSettings
4+
{
5+
public string From { get; set; } = string.Empty;
6+
public string Username { get; set; } = string.Empty;
7+
public string Password { get; set; } = string.Empty;
8+
public string Host { get; set; } = string.Empty;
9+
public short Port { get; set; }
10+
public bool EnableSSL { get; set; }
11+
}
12+
}

HamEvent/Program.cs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
using HamEvent;
66
using HamEvent.Data;
77
using HamEvent.Services;
8-
using Microsoft.AspNetCore.Builder;
9-
using Microsoft.AspNetCore.Hosting;
108
using Microsoft.EntityFrameworkCore;
11-
using Microsoft.Extensions.Configuration;
129
using NReco.Logging.File;
10+
using System.Configuration;
1311
using System.Net;
14-
using System.Net.Mail;
1512

1613

1714
var builder = WebApplication.CreateBuilder(args);
@@ -21,8 +18,8 @@
2118
builder.Services.AddScoped<ICoreMvcMailer, CoreMvcMailer>();
2219
builder.Services.AddRazorPages();
2320
builder.Services.AddControllersWithViews();
24-
builder.Services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
25-
var tokenSecret = builder.Configuration["Token:Secret"] ?? throw new ArgumentNullException("Token:Secret", "Token secret is not configured.");
21+
builder.Services.AddAutoMapper(cfg => { }, AppDomain.CurrentDomain.GetAssemblies());
22+
var tokenSecret = builder.Configuration["Token:Secret"] ?? throw new ConfigurationErrorsException("Token secret is not configured.");
2623

2724
builder.Services.AddSingleton<TokenService>(provider => new TokenService(tokenSecret));
2825

@@ -39,9 +36,8 @@
3936
{
4037
options.Filters.Add(new MyElmahFilter());
4138
options.OnPermissionCheck = context => wl.Whitelist
42-
.Where(ip => IPAddress.Parse(ip)
43-
.Equals(context.Connection.RemoteIpAddress))
44-
.Any();
39+
.Any(ip => IPAddress.Parse(ip)
40+
.Equals(context.Connection.RemoteIpAddress));
4541
options.LogPath = "~/log";
4642
});
4743
builder.Services.AddLogging(loggingBuilder => {
@@ -70,14 +66,3 @@
7066
app.MapFallbackToFile("index.html");
7167
app.UseElmah();
7268
app.Run();
73-
74-
75-
public class MailerSettings
76-
{
77-
public string From { get; set; } = String.Empty;
78-
public string Username { get; set; } = String.Empty;
79-
public string Password { get; set; } = String.Empty;
80-
public string Host { get; set; } = String.Empty;
81-
public short Port { get; set; }
82-
public Boolean EnableSSL { get; set; }
83-
}

UnitTests/HamEventControllerTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using AutoMapper;
2-
using Castle.Core.Logging;
32
using CoreMailer.Interfaces;
3+
using HamEvent;
44
using HamEvent.Controllers;
55
using HamEvent.Data;
66
using HamEvent.Data.Model;
@@ -10,7 +10,6 @@
1010
using Microsoft.Extensions.Options;
1111
using Moq;
1212
using Moq.EntityFrameworkCore;
13-
using System.Collections.Generic;
1413

1514
namespace UnitTests
1615
{
@@ -60,8 +59,8 @@ public void GetLive()
6059
//Assert
6160
Assert.NotNull(operators);
6261
Assert.Equal(2, operators.Count);
63-
Assert.Equal(2, operators.Where(o => o.Callsign.Equals("Callsign1")).First().lastQSOs.Count());
64-
Assert.Single(operators.Where(o => o.Callsign.Equals("Callsign11")).First().lastQSOs);
62+
Assert.Equal(2, operators.First(o => o.Callsign.Equals("Callsign1")).lastQSOs.Count());
63+
Assert.Single(operators.First(o => o.Callsign.Equals("Callsign11")).lastQSOs);
6564
}
6665

6766
//add test for [HttpGet("QSOs/{hamevent}")]

UnitTests/UnitTests.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

88
<IsPackable>false</IsPackable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
1313
<PackageReference Include="Moq" Version="4.20.72" />
1414
<PackageReference Include="Moq.EntityFrameworkCore" Version="9.0.0.5" />
15+
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
1516
<PackageReference Include="xunit" Version="2.9.3" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
17+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
1718
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1819
<PrivateAssets>all</PrivateAssets>
1920
</PackageReference>

0 commit comments

Comments
 (0)