1
0
mirror of https://github.com/bitwarden/server synced 2025-12-24 12:13:17 +00:00

Add async suffix to remaining methods

This commit is contained in:
Hinton
2025-12-18 14:16:41 +01:00
parent 742f77d531
commit afce475833
3 changed files with 11 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ public class SeedController(ILogger<SeedController> logger, ISceneService sceneS
try
{
var response = await sceneService.ExecuteScene(request.Template, request.Arguments);
var response = await sceneService.ExecuteSceneAsync(request.Template, request.Arguments);
return Json(response);
}
@@ -36,7 +36,7 @@ public class SeedController(ILogger<SeedController> logger, ISceneService sceneS
try
{
await sceneService.DestroyScenes(playIds);
await sceneService.DestroyScenesAsync(playIds);
return Ok(new { Message = "Batch delete completed successfully" });
}
catch (AggregateException ex)
@@ -56,7 +56,7 @@ public class SeedController(ILogger<SeedController> logger, ISceneService sceneS
try
{
var result = await sceneService.DestroyScene(playId);
var result = await sceneService.DestroySceneAsync(playId);
return Json(result);
}
@@ -77,7 +77,7 @@ public class SeedController(ILogger<SeedController> logger, ISceneService sceneS
try
{
await sceneService.DestroyScenes(playIds);
await sceneService.DestroyScenesAsync(playIds);
return NoContent();
}
catch (AggregateException ex)

View File

@@ -21,7 +21,7 @@ public interface ISceneService
/// <returns>A tuple containing the result and optional seed ID for tracked entities</returns>
/// <exception cref="SceneNotFoundException">Thrown when the scene template is not found</exception>
/// <exception cref="SceneExecutionException">Thrown when there's an error executing the scene</exception>
Task<SceneResponseModel> ExecuteScene(string templateName, JsonElement? arguments);
Task<SceneResponseModel> ExecuteSceneAsync(string templateName, JsonElement? arguments);
/// <summary>
/// Destroys data created by a scene using the seeded data ID.
@@ -29,7 +29,7 @@ public interface ISceneService
/// <param name="playId">The ID of the seeded data to destroy</param>
/// <returns>The result of the destroy operation</returns>
/// <exception cref="SceneExecutionException">Thrown when there's an error destroying the seeded data</exception>
Task<object?> DestroyScene(string playId);
Task<object?> DestroySceneAsync(string playId);
/// <summary>
/// Retrieves all play IDs for currently tracked seeded data.
@@ -42,5 +42,5 @@ public interface ISceneService
/// </summary>
/// <param name="playIds">The list of play IDs to destroy</param>
/// <exception cref="AggregateException">Thrown when one or more scenes fail to destroy</exception>
Task DestroyScenes(IEnumerable<string> playIds);
Task DestroyScenesAsync(IEnumerable<string> playIds);
}

View File

@@ -29,14 +29,14 @@ public class SceneService(
.ToList();
}
public async Task<SceneResponseModel> ExecuteScene(string templateName, JsonElement? arguments)
public async Task<SceneResponseModel> ExecuteSceneAsync(string templateName, JsonElement? arguments)
{
var result = await ExecuteSceneMethodAsync(templateName, arguments, "Seed");
return SceneResponseModel.FromSceneResult(result);
}
public async Task<object?> DestroyScene(string playId)
public async Task<object?> DestroySceneAsync(string playId)
{
// Note, delete cascade will remove PlayData entries
@@ -80,7 +80,7 @@ public class SceneService(
return new { PlayId = playId };
}
public async Task DestroyScenes(IEnumerable<string> playIds)
public async Task DestroyScenesAsync(IEnumerable<string> playIds)
{
var exceptions = new List<Exception>();
@@ -88,7 +88,7 @@ public class SceneService(
{
try
{
await DestroyScene(playId);
await DestroySceneAsync(playId);
}
catch (Exception ex)
{