Skip to content

Commit a44850c

Browse files
author
Timothy Dodd
committed
Update project dependencies and refactor database handling
- Added permissions for Bash commands in `settings.local.json`. - Updated `LogMk.sln` to include `RoboDodd.OrmLite` and `RoboDodd.OrmLite.Tests`. - Changed package versions from `9.0.8` to `9.0.9` in `LogMkAgent.csproj` and `LogMkApi.csproj`. - Refactored namespaces from `ServiceStack` to `RoboDodd.OrmLite` across multiple files. - Replaced `IDbConnectionFactory` with `DbConnectionFactory` in various services and controllers. - Removed `SqlExtensions.cs` file. - Updated package versions in `package-lock.json` and `package.json`. - Committed changes in the `RoboDodd.OrmLite` subproject.
1 parent 68ebe7c commit a44850c

27 files changed

+614
-787
lines changed

.claude/settings.local.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"permissions": {
33
"allow": [
4-
"Bash(ng generate:*)"
4+
"Bash(ng generate:*)",
5+
"Bash(dotnet test:*)",
6+
"Bash(timeout 30 dotnet test src/RoboDodd.OrmLite.Tests/RoboDodd.OrmLite.Tests.csproj --filter \"FullyQualifiedName=RoboDodd.OrmLite.Tests.ServiceStackMigrationIntegrationTests.ErrorHandling_WithInvalidOperations_HandlesGracefully\" --verbosity normal)",
7+
"Bash(timeout:*)"
58
],
69
"deny": []
710
}

src/LogMk.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution-files", "solution-
1717
..\README.md = ..\README.md
1818
EndProjectSection
1919
EndProject
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoboDodd.OrmLite", "RoboDodd.OrmLite\src\RoboDodd.OrmLite\RoboDodd.OrmLite.csproj", "{E1D76D8A-E66B-4AF8-867E-ED2254DE9E25}"
21+
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoboDodd.OrmLite.Tests", "RoboDodd.OrmLite\src\RoboDodd.OrmLite.Tests\RoboDodd.OrmLite.Tests.csproj", "{AFB4864F-80DD-A42F-380E-A952B4744741}"
23+
EndProject
2024
Global
2125
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2226
Debug|Any CPU = Debug|Any CPU
@@ -41,6 +45,14 @@ Global
4145
{DB0AC211-D6C7-442B-9F6F-C87CB78BE305}.Release|Any CPU.ActiveCfg = Release|Any CPU
4246
{DB0AC211-D6C7-442B-9F6F-C87CB78BE305}.Release|Any CPU.Build.0 = Release|Any CPU
4347
{DB0AC211-D6C7-442B-9F6F-C87CB78BE305}.Release|Any CPU.Deploy.0 = Release|Any CPU
48+
{E1D76D8A-E66B-4AF8-867E-ED2254DE9E25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{E1D76D8A-E66B-4AF8-867E-ED2254DE9E25}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{E1D76D8A-E66B-4AF8-867E-ED2254DE9E25}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{E1D76D8A-E66B-4AF8-867E-ED2254DE9E25}.Release|Any CPU.Build.0 = Release|Any CPU
52+
{AFB4864F-80DD-A42F-380E-A952B4744741}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53+
{AFB4864F-80DD-A42F-380E-A952B4744741}.Debug|Any CPU.Build.0 = Debug|Any CPU
54+
{AFB4864F-80DD-A42F-380E-A952B4744741}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{AFB4864F-80DD-A42F-380E-A952B4744741}.Release|Any CPU.Build.0 = Release|Any CPU
4456
EndGlobalSection
4557
GlobalSection(SolutionProperties) = preSolution
4658
HideSolutionNode = FALSE

src/LogMkAgent/LogMkAgent.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.8" />
17-
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
18-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.8" />
19-
<PackageReference Include="System.Text.Json" Version="9.0.8" />
16+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.9" />
17+
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.9" />
18+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
19+
<PackageReference Include="System.Text.Json" Version="9.0.9" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

src/LogMkApi/Common/DateTimeHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Data;
2-
using ServiceStack.OrmLite.Dapper;
2+
using RoboDodd.OrmLite;
33

44
namespace LogMkApi.Common;
55

src/LogMkApi/Common/HealthCheck/HealthChecks.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Text.Json;
22
using LogMkApi.HealthChecks;
33
using Microsoft.Extensions.Diagnostics.HealthChecks;
4-
using ServiceStack.Data;
4+
using RoboDodd.OrmLite;
55

66
namespace LogMkApi.Common.HealthCheck;
77

@@ -11,7 +11,7 @@ public static class HealthCheck
1111
{
1212
WriteIndented = true
1313
};
14-
public static void AddHealthChecks(IServiceCollection services, IDbConnectionFactory dbFactory)
14+
public static void AddHealthChecks(IServiceCollection services, DbConnectionFactory dbFactory)
1515
{
1616
_ = services.AddHealthChecks().AddCheck("database", new MySqlHealthCheck(dbFactory, "Log"))
1717
.AddCheck<LoggingMetricsHealthCheck>(
@@ -45,7 +45,7 @@ public static async Task WriteResponse(HttpContext context,
4545
}
4646
public static class HealthCheckExtensions
4747
{
48-
public static IHealthChecksBuilder AddLogMkHealthChecks(this IHealthChecksBuilder builder, string name, IDbConnectionFactory dbFactory)
48+
public static IHealthChecksBuilder AddLogMkHealthChecks(this IHealthChecksBuilder builder, string name, DbConnectionFactory dbFactory)
4949
{
5050
return builder.AddCheck(name, new MySqlHealthCheck(dbFactory, "Log"))
5151
.AddCheck<LoggingMetricsHealthCheck>(

src/LogMkApi/Common/HealthCheck/MySqlHealthcheck.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
using System.Diagnostics;
44
using System.Threading;
55
using System.Threading.Tasks;
6+
using Dapper;
67
using Microsoft.Extensions.Diagnostics.HealthChecks;
7-
using ServiceStack.Data;
8-
using ServiceStack.OrmLite;
8+
using RoboDodd.OrmLite;
99

1010
public class MySqlHealthCheck : IHealthCheck
1111
{
12-
private readonly IDbConnectionFactory _dbFactory;
12+
private readonly DbConnectionFactory _dbFactory;
1313
private readonly string _table;
14-
public MySqlHealthCheck(IDbConnectionFactory dbFactory, string table)
14+
public MySqlHealthCheck(DbConnectionFactory dbFactory, string table)
1515
{
1616
_dbFactory = dbFactory;
1717
_table = table;
@@ -25,12 +25,12 @@ public async Task<HealthCheckResult> CheckHealthAsync(
2525

2626
try
2727
{
28-
using var connection = await _dbFactory.OpenDbConnectionAsync();
28+
using var connection = _dbFactory.CreateConnection();
2929
using var command = connection.CreateCommand();
3030

3131

32-
command.CommandText = $"SELECT * FROM {_table} limit 1";
33-
await command.ExecNonQueryAsync();
32+
33+
await connection.ExecuteAsync($"SELECT * FROM {_table} limit 1");
3434

3535
stopwatch.Stop();
3636

src/LogMkApi/Common/SqlExtensions.cs

Lines changed: 0 additions & 245 deletions
This file was deleted.

0 commit comments

Comments
 (0)