11 Commits

Author SHA1 Message Date
Developer 02
c16d58788a Refactor switch statement to switch expression
Replaced the `switch` statement with a `switch` expression to handle HTTP methods (`GET`, `POST`, `PUT`, `DELETE`). This refactoring reduces boilerplate code and improves readability by directly assigning the HTTP request result to the `response` variable, eliminating the need for multiple `using` and `break` statements.
2025-11-26 17:34:42 +01:00
Developer 02
a854720c75 Add DELETE request handling in command handler
Implemented the handling of DELETE HTTP requests in the
InvokeRecActionCommandHandler class. Previously, the DELETE
case was unhandled, and now it uses http.DeleteAsync to
send a DELETE request to the specified action.EndpointUri,
supporting cancellation with the cancel token.
2025-11-26 17:29:58 +01:00
Developer 02
c6bcdc3fac Add PUT request handling in InvokeRecActionCommandHandler
Implemented HTTP PUT request handling in the
InvokeRecActionCommandHandler class. Previously, the PUT case
only had a placeholder comment. Now, it uses
http.PutAsync to send a PUT request to the specified
action.EndpointUri, aligning it with the existing POST
request handling.
2025-11-26 17:29:29 +01:00
Developer 02
a57f53b6a1 Add POST request handling in InvokeRecActionCommandHandler
Previously, the handling of HTTP POST requests in the
InvokeRecActionCommandHandler class was not implemented.
This commit adds the necessary code to handle POST requests
by using the http.PostAsync method. The POST request is sent
to the specified action.EndpointUri with null content and a
cancellation token. This change ensures that POST operations
are now properly executed within the command handler.
2025-11-26 17:29:06 +01:00
Developer 02
eb402504ff Refactor HTTP request handling in action loop
Updated the HTTP request handling logic within the action loop to dynamically construct requests based on the `RestType` and `EndpointUri` of each action. Expanded the switch statement to handle GET, POST, PUT, and DELETE methods, allowing for specific logic to be implemented for each. Removed the hardcoded URL and response content retrieval, indicating potential refactoring of response handling. The default case continues to throw a `BadRequestException` for unsupported REST types.
2025-11-26 17:28:26 +01:00
Developer 02
5b7fce8fd6 Make RestType handling case-insensitive in switch
Convert RestType to uppercase in the switch statement to
ensure case-insensitive matching of REST types. This change
handles variations like "get", "Get", and "GET" consistently.
Additionally, use the null-conditional operator to prevent
NullReferenceException when RestType is null.
2025-11-26 17:23:51 +01:00
Developer 02
9a0a37471e Add REST action handling in InvokeRecActionCommand
Refactor `using` directives in `InvokeRecActionCommand.cs` to include `DigitalData.Core.Exceptions` and `System.Net.Http`.

Implement logic in `InvokeRecActionCommandHandler` to handle different REST actions using `HttpClient`. Introduce a `switch` statement to process "GET", "POST", "PUT", and "DELETE" actions, with a `BadRequestException` for unsupported types. Read HTTP response content asynchronously.
2025-11-26 17:23:14 +01:00
Developer 02
dcd399a92e add logic to read actions 2025-11-26 17:17:32 +01:00
Developer 02
59152a5621 umdate inveokeRecActionCommand 2025-11-26 17:16:01 +01:00
5697eb3dd8 Add InvokeRecActionCommandExtensions for ISender
Introduce a new static class `InvokeRecActionCommandExtensions`
to extend the `ISender` interface with the `InvokeRecAction`
method. This method simplifies the invocation of
`InvokeRecActionCommand` by allowing callers to pass only the
`profileId`, internally creating and sending the command.
2025-11-25 17:10:44 +01:00
2cf4d73cf3 Refactor InvokeRecActionQuery to InvokeRecActionCommand
Replaced the `InvokeRecActionQuery` class with the `InvokeRecActionCommand` class to better align with CQRS semantics. The new class retains the same `ProfileId` property and implements the `IRequest` interface. Updated the namespace to remain consistent.
2025-11-25 17:08:24 +01:00