diff --git a/dependencies.props b/dependencies.props
index 11b84d3..0115a99 100644
--- a/dependencies.props
+++ b/dependencies.props
@@ -6,12 +6,12 @@
5.0.7
4.1.0
5.0.0
- 1.0.2
+ 1.0.4
1.0.7
1.1.3
10.1.1
3.3.0
5.0.7
- 6.0.0
+ 9.0.0
\ No newline at end of file
diff --git a/src/server/ProxmoxConnector.Server.Application/Queries/Query.cs b/src/server/ProxmoxConnector.Server.Application/Queries/Query.cs
deleted file mode 100644
index c7248c1..0000000
--- a/src/server/ProxmoxConnector.Server.Application/Queries/Query.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-using MediatR;
-
-namespace ProxmoxConnector.Server.Application.Queries
-{
- public abstract class Query : IRequest, IBaseRequest
- {
- }
-}
diff --git a/src/server/ProxmoxConnector.Server.Application/Queries/System/GetSystemVersion.cs b/src/server/ProxmoxConnector.Server.Application/Queries/System/GetSystemVersion.cs
index d587a60..bc75de1 100644
--- a/src/server/ProxmoxConnector.Server.Application/Queries/System/GetSystemVersion.cs
+++ b/src/server/ProxmoxConnector.Server.Application/Queries/System/GetSystemVersion.cs
@@ -7,16 +7,11 @@ namespace ProxmoxConnector.Server.Application.Queries.System
{
public class GetSystemVersion
{
- public class Query : Query
- {
- public Query()
- {
- }
- }
+ public record Query : IRequest { }
- public class Model
+ public record Model
{
- public string Version { get; set; }
+ public string Version { get; init; }
}
public class QueryHandler : IRequestHandler
diff --git a/src/server/ProxmoxConnector.Server.Application/Queries/TestQ.cs b/src/server/ProxmoxConnector.Server.Application/Queries/TestQ.cs
index 9a9ae5e..7fa0e78 100644
--- a/src/server/ProxmoxConnector.Server.Application/Queries/TestQ.cs
+++ b/src/server/ProxmoxConnector.Server.Application/Queries/TestQ.cs
@@ -8,16 +8,13 @@ namespace ProxmoxConnector.Server.Application.Queries
{
public class TestQ
{
- public class Query : Query
+ public record Query : IRequest
{
- public Query()
- {
- }
}
- public class Model
+ public record Model
{
- public string Msg { get; set; }
+ public string Msg { get; init; }
}
public class QueryHandler : IRequestHandler
@@ -29,10 +26,6 @@ namespace ProxmoxConnector.Server.Application.Queries
_pveConnector=pveConnector;
}
- public QueryHandler()
- {
- }
-
public async Task Handle(Query request, CancellationToken cancellationToken)
{
await _pveConnector.TestWithLogin();
diff --git a/src/server/ProxmoxConnector.Server/Startup.cs b/src/server/ProxmoxConnector.Server/Startup.cs
index 08d0bb3..2a95da4 100644
--- a/src/server/ProxmoxConnector.Server/Startup.cs
+++ b/src/server/ProxmoxConnector.Server/Startup.cs
@@ -34,7 +34,7 @@ namespace ProxmoxConnector.Server
services.AddIdentityAuthentication(_configuration.GetSection("IdentityServer")["BaseAddress"]);
// MediatR
- services.AddMediatR(GetMediatRAssemblies());
+ services.AddMediatR(typeof(Application.Queries.System.GetSystemVersion).Assembly);
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(RequestPreProcessorBehavior<,>));
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(RequestPostProcessorBehavior<,>));
@@ -69,11 +69,5 @@ namespace ProxmoxConnector.Server
app.UseMigration();
}
-
- private Assembly[] GetMediatRAssemblies()
- {
- var assembly = typeof(Application.Queries.System.GetSystemVersion).Assembly;
- return new Assembly[] { assembly };
- }
}
}