Refactor: Rename GetDynamicAsync to GetAsync
Renamed `GetDynamicAsync` to `GetAsync` across `ProfileApi.cs`, `RecActionApi.cs`, and `ResultApi.cs` to improve consistency and align with naming conventions for asynchronous methods. Updated XML documentation to clarify that the non-generic `GetAsync` overload returns a dynamically deserialized payload, typically a `System.Text.Json.JsonElement`. Highlighted its relation to the generic `GetAsync<T>` method. Adjusted method signatures for both `NETFRAMEWORK` and non-`NETFRAMEWORK` code paths. Updated test files (`ProfileApiTests.cs`, `RecActionApiTests.cs`, and `ResultApiTests.cs`) to reflect the renaming, including test method names and assertions. These changes enhance code readability, maintainability, and consistency.
This commit is contained in:
@@ -41,16 +41,18 @@ namespace ReC.Client.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves profiles and returns a dynamically deserialized payload.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Retrieves profiles and returns a dynamically deserialized payload
|
||||
/// (typically a <see cref="System.Text.Json.JsonElement"/>). This is the non-generic
|
||||
/// overload of <see cref="GetAsync{T}"/>.
|
||||
/// </summary>
|
||||
#if NETFRAMEWORK
|
||||
public Task<dynamic> GetDynamicAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default)
|
||||
public Task<dynamic> GetAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default)
|
||||
#else
|
||||
public Task<dynamic?> GetDynamicAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default)
|
||||
public Task<dynamic?> GetAsync(long? id = null, bool includeActions = true, CancellationToken cancel = default)
|
||||
#endif
|
||||
{
|
||||
return GetAsync<object>(id, includeActions, cancel);
|
||||
}
|
||||
{
|
||||
return GetAsync<object>(id, includeActions, cancel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,12 +75,14 @@ namespace ReC.Client.Api
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves Rec actions and returns a dynamically deserialized payload.
|
||||
/// Retrieves Rec actions and returns a dynamically deserialized payload
|
||||
/// (typically a <see cref="System.Text.Json.JsonElement"/>). This is the non-generic
|
||||
/// overload of <see cref="GetAsync{T}"/>.
|
||||
/// </summary>
|
||||
#if NETFRAMEWORK
|
||||
public Task<dynamic> GetDynamicAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default)
|
||||
public Task<dynamic> GetAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default)
|
||||
#else
|
||||
public Task<dynamic?> GetDynamicAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default)
|
||||
public Task<dynamic?> GetAsync(long? profileId = null, bool? invoked = null, CancellationToken cancel = default)
|
||||
#endif
|
||||
{
|
||||
return GetAsync<object>(profileId, invoked, cancel);
|
||||
|
||||
@@ -49,16 +49,18 @@ namespace ReC.Client.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves results with optional filters and returns a dynamically deserialized payload.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Retrieves results with optional filters and returns a dynamically deserialized payload
|
||||
/// (typically a <see cref="System.Text.Json.JsonElement"/>). This is the non-generic
|
||||
/// overload of <see cref="GetAsync{T}"/>.
|
||||
/// </summary>
|
||||
#if NETFRAMEWORK
|
||||
public Task<dynamic> GetDynamicAsync(long? id = null, long? actionId = null, long? profileId = null, string batchId = null, bool includeAction = true, bool includeProfile = false, bool lastBatch = false, CancellationToken cancel = default)
|
||||
public Task<dynamic> GetAsync(long? id = null, long? actionId = null, long? profileId = null, string batchId = null, bool includeAction = true, bool includeProfile = false, bool lastBatch = false, CancellationToken cancel = default)
|
||||
#else
|
||||
public Task<dynamic?> GetDynamicAsync(long? id = null, long? actionId = null, long? profileId = null, string? batchId = null, bool includeAction = true, bool includeProfile = false, bool lastBatch = false, CancellationToken cancel = default)
|
||||
public Task<dynamic?> GetAsync(long? id = null, long? actionId = null, long? profileId = null, string? batchId = null, bool includeAction = true, bool includeProfile = false, bool lastBatch = false, CancellationToken cancel = default)
|
||||
#endif
|
||||
{
|
||||
return GetAsync<object>(id, actionId, profileId, batchId, includeAction, includeProfile, lastBatch, cancel);
|
||||
}
|
||||
{
|
||||
return GetAsync<object>(id, actionId, profileId, batchId, includeAction, includeProfile, lastBatch, cancel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user