From 0f09e8dad07a650afc45d61053b32b23546aedcc Mon Sep 17 00:00:00 2001 From: quyvu Date: Mon, 6 Jan 2025 10:26:44 +0700 Subject: [PATCH] Update OfX-gRPC-> create clients fetching data implementations based on hostMapConfig! Change Name NatsClientHost.NatsHost -> NatsUrl --- src/OfX.EntityFrameworkCore/OfX.EntityFrameworkCore.csproj | 2 +- src/OfX.Grpc/Extensions/GrpcExtensions.cs | 3 ++- src/OfX.Grpc/OfX.Grpc.csproj | 2 +- src/OfX.Nats/ApplicationModels/NatsClientHost.cs | 4 ++-- src/OfX.Nats/Extensions/NatsExtensions.cs | 2 +- src/OfX.Nats/OfX.Nats.csproj | 2 +- src/OfX/OfX.csproj | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/OfX.EntityFrameworkCore/OfX.EntityFrameworkCore.csproj b/src/OfX.EntityFrameworkCore/OfX.EntityFrameworkCore.csproj index df16be1..a1a0939 100644 --- a/src/OfX.EntityFrameworkCore/OfX.EntityFrameworkCore.csproj +++ b/src/OfX.EntityFrameworkCore/OfX.EntityFrameworkCore.csproj @@ -4,7 +4,7 @@ enable net9.0;net8.0 default - 3.1.5 + 3.1.6 Quy Vu OfX-EFCore OfX extension. Use EntityFramework as Data Querying diff --git a/src/OfX.Grpc/Extensions/GrpcExtensions.cs b/src/OfX.Grpc/Extensions/GrpcExtensions.cs index ec4fc89..699a9a4 100644 --- a/src/OfX.Grpc/Extensions/GrpcExtensions.cs +++ b/src/OfX.Grpc/Extensions/GrpcExtensions.cs @@ -25,6 +25,7 @@ public static void AddGrpcClients(this OfXRegister ofXRegister, Action a.Value); ofXRegister.ServiceCollection.TryAddScoped(_ => attributeType => async (query, context) => { @@ -40,7 +41,7 @@ public static void AddGrpcClients(this OfXRegister ofXRegister, Action), [..ofXRegister.OfXAttributeTypes]); + typeof(IOfXGrpcRequestClient<>), [..attributeRegisters]); } private static async Task GetOfXItemsAsync(string serverHost, IContext context, diff --git a/src/OfX.Grpc/OfX.Grpc.csproj b/src/OfX.Grpc/OfX.Grpc.csproj index e73a73c..7293955 100644 --- a/src/OfX.Grpc/OfX.Grpc.csproj +++ b/src/OfX.Grpc/OfX.Grpc.csproj @@ -4,7 +4,7 @@ enable net9.0;net8.0 default - 3.1.5 + 3.1.6 Quy Vu OfX-gRPC OfX extension. Use gRPC as Data transporting diff --git a/src/OfX.Nats/ApplicationModels/NatsClientHost.cs b/src/OfX.Nats/ApplicationModels/NatsClientHost.cs index e3209de..e2cf5b0 100644 --- a/src/OfX.Nats/ApplicationModels/NatsClientHost.cs +++ b/src/OfX.Nats/ApplicationModels/NatsClientHost.cs @@ -2,7 +2,7 @@ namespace OfX.Nats.ApplicationModels; public class NatsClientHost { - public string NatsHost { get; private set; } + public string NatsUrl { get; private set; } - public void Url(string host) => NatsHost = host; + public void Url(string host) => NatsUrl = host; } \ No newline at end of file diff --git a/src/OfX.Nats/Extensions/NatsExtensions.cs b/src/OfX.Nats/Extensions/NatsExtensions.cs index 482ccb2..3772a1f 100644 --- a/src/OfX.Nats/Extensions/NatsExtensions.cs +++ b/src/OfX.Nats/Extensions/NatsExtensions.cs @@ -18,7 +18,7 @@ public static void AddNats(this OfXRegister ofXRegister, Action ofXRegister.ServiceCollection.AddSingleton(_ => { - var client = new NatsClient(newClientsRegister.NatsHost); + var client = new NatsClient(newClientsRegister.NatsUrl); return client; }); ClientsRegister(ofXRegister.ServiceCollection); diff --git a/src/OfX.Nats/OfX.Nats.csproj b/src/OfX.Nats/OfX.Nats.csproj index f67883f..1e2dcc7 100644 --- a/src/OfX.Nats/OfX.Nats.csproj +++ b/src/OfX.Nats/OfX.Nats.csproj @@ -4,7 +4,7 @@ enable net9.0;net8.0 default - 3.1.4 + 3.1.6 Quy Vu OfX-Nats Nats.io extension. Use Nats as Data transporting diff --git a/src/OfX/OfX.csproj b/src/OfX/OfX.csproj index b85b2f8..ebff286 100644 --- a/src/OfX/OfX.csproj +++ b/src/OfX/OfX.csproj @@ -4,7 +4,7 @@ enable net9.0;net8.0 default - 3.1.5 + 3.1.6 Quy Vu OfX The high performance and easiest way to play with microservices for .NET