11 Commits

Author SHA1 Message Date
Developer 02
b190e4f5e9 Update InvokeRecActionAsync to return success status
The method `InvokeRecActionAsync` in the `ReC.Client` namespace was updated to return a `bool` instead of `Task`. This change allows the method to indicate whether the HTTP request was successful.

- Updated the return type from `Task` to `Task<bool>`.
- Modified the `<returns>` XML documentation to reflect the new behavior.
- Replaced `resp.EnsureSuccessStatusCode()` with `resp.IsSuccessStatusCode` to return the success status directly.
2025-12-05 23:36:45 +01:00
Developer 02
4a1b221478 Rename 'ct' to 'cancellationToken' for clarity
Updated the parameter name in the `InvokeRecActionAsync` method
to `cancellationToken` for better readability and alignment
with standard naming conventions. Adjusted the method signature
and internal usage to reflect this change.
2025-12-05 23:31:17 +01:00
Developer 02
475acc0a56 Remove InvokeRecActionFakeAsync method
Removed the `InvokeRecActionFakeAsync` method, which was used to invoke a fake RecAction via the `api/RecAction/invoke/fake` endpoint. This method is no longer needed or relevant.

The `InvokeRecActionAsync` method remains in place to handle RecActions for specific profile IDs via the `api/RecAction/invoke/{profileId}` endpoint.
2025-12-05 23:29:43 +01:00
Developer 02
f8dd16454f Add AddRecClient method and conditional using directive
Added a `using System.Net.Http;` directive within a `#if NETFRAMEWORK` block in `DependencyInjection.cs` to ensure compatibility with .NET Framework.

Introduced the `AddRecClient` extension method in the `DependencyInjection` class to enable custom configuration of `HttpClient` instances via an `Action<HttpClient>` delegate.
2025-12-05 23:24:44 +01:00
Developer 02
8cad1df95d Add DependencyInjection support for ReCClient
Introduced a `DependencyInjection` class in the `ReC.Client`
namespace to enable dependency injection for `ReCClient`.

Added an `AddRecClient` extension method for `IServiceCollection`
to register an `HttpClient` with a configurable `apiUri` as the
base address.

Included conditional `using System;` for .NET Framework
compatibility and added `Microsoft.Extensions.DependencyInjection`
to support DI services.
2025-12-05 23:23:17 +01:00
Developer 02
4ee79d6cd8 Refactor ReCClient for cleaner and more flexible design
- Removed unused `System.Xml.Linq` namespace import.
- Simplified code by removing `#if NETFRAMEWORK` directives.
- Added `ClientName` field to uniquely identify HTTP clients.
- Updated constructor to use named HTTP client with `ClientName`.
- Removed unused `_jsonOptions` field for better code clarity.
2025-12-05 23:17:45 +01:00
Developer 02
c0c0650fee Refactor ReCClient to use IHttpClientFactory
Updated ReCClient to use IHttpClientFactory for improved
resource management and testability. Added package
references for `Microsoft.Extensions.Http`, `System.Net.Http`,
and `System.Text.Json` to support HTTP client functionality
and JSON serialization. Included `System.Xml.Linq` for
potential XML-related operations. Updated constructor logic
to create `HttpClient` instances via the factory pattern.
2025-12-05 23:11:35 +01:00
Developer 02
73059d4554 Add InvokeRecActionFakeAsync method to ReCClient
A new asynchronous method `InvokeRecActionFakeAsync` was added to the `ReC.Client` namespace in `ReCClient.cs`. This method sends a POST request to the `api/RecAction/invoke/fake` endpoint. It includes XML documentation comments and accepts an optional `CancellationToken` parameter. The method ensures the response has a successful status code.
2025-12-05 23:03:03 +01:00
Developer 02
e774afc85e Add InvokeRecActionAsync method to ReCClient class
Added the `InvokeRecActionAsync` method to the `ReCClient` class in the `ReC.Client` namespace. This method performs an asynchronous HTTP POST request to the `api/RecAction/invoke/{profileId}` endpoint. It accepts a `profileId` parameter to specify the profile ID and an optional `CancellationToken` for task cancellation. The method ensures the HTTP response indicates success by calling `EnsureSuccessStatusCode()`. Included XML documentation comments for clarity and maintainability.
2025-12-05 23:02:45 +01:00
Developer 02
1fc4570210 Add ReCClient class and update project dependencies
Added `ReCClient` class to handle HTTP requests with JSON
serialization/deserialization support. Updated `ReC.Client.csproj`
to include `System.Net.Http` (v4.3.4) and `System.Text.Json`
(v9.0.11) as package references. Introduced conditional `using`
directives for `NETFRAMEWORK` compatibility.
2025-12-05 22:45:19 +01:00
3f5d3a8c08 Add new ReC.Client project to solution
A new project, ReC.Client, has been added to the solution file (ReC.sln).
The project supports two target frameworks: net462 and net8.0.
Build configurations for Debug and Release have been added, and the
project has been nested under the same parent as other projects.

The ReC.Client.csproj file uses the Microsoft.NET.Sdk SDK and includes
conditional properties for frameworks other than net462, enabling
implicit global usings and nullable reference types.
2025-11-25 00:40:59 +01:00