Refactor API method names for consistency and clarity
Renamed public API methods across ReC.Client.Api classes to use concise and uniform names (e.g., CreateAsync, UpdateAsync, DeleteAsync, GetAsync, InvokeAsync). Removed obsolete NETFRAMEWORK preprocessor blocks. Updated summary comment for Results property in ReCClient.cs. These changes improve naming consistency and code clarity throughout the client library.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#if NETFRAMEWORK
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
|
||||
namespace ReC.Client.Api
|
||||
{
|
||||
@@ -29,7 +27,7 @@ namespace ReC.Client.Api
|
||||
/// <param name="procedure">The payload to send.</param>
|
||||
/// <param name="cancel">A token to cancel the operation.</param>
|
||||
/// <returns>The HTTP response message.</returns>
|
||||
public Task<HttpResponseMessage> CreateEndpointAuthAsync<T>(T procedure, CancellationToken cancel = default)
|
||||
public Task<HttpResponseMessage> CreateAsync<T>(T procedure, CancellationToken cancel = default)
|
||||
=> _http.PostAsync("api/EndpointAuth", ReCClientHelpers.ToJsonContent(procedure), cancel);
|
||||
|
||||
/// <summary>
|
||||
@@ -40,7 +38,7 @@ namespace ReC.Client.Api
|
||||
/// <param name="procedure">The payload to send.</param>
|
||||
/// <param name="cancel">A token to cancel the operation.</param>
|
||||
/// <returns>The HTTP response message.</returns>
|
||||
public Task<HttpResponseMessage> UpdateEndpointAuthAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||
public Task<HttpResponseMessage> UpdateAsync<T>(long id, T procedure, CancellationToken cancel = default)
|
||||
=> _http.PutAsync($"api/EndpointAuth/{id}", ReCClientHelpers.ToJsonContent(procedure), cancel);
|
||||
|
||||
/// <summary>
|
||||
@@ -50,7 +48,7 @@ namespace ReC.Client.Api
|
||||
/// <param name="procedure">The payload to send.</param>
|
||||
/// <param name="cancel">A token to cancel the operation.</param>
|
||||
/// <returns>The HTTP response message.</returns>
|
||||
public Task<HttpResponseMessage> DeleteEndpointAuthAsync<T>(T procedure, CancellationToken cancel = default)
|
||||
public Task<HttpResponseMessage> DeleteAsync<T>(T procedure, CancellationToken cancel = default)
|
||||
{
|
||||
var request = new HttpRequestMessage(HttpMethod.Delete, "api/EndpointAuth")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user