Make code more understandable
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-19 17:05:19 +02:00
parent fd9b9c7c2e
commit b07b0c1f0f
2 changed files with 12 additions and 6 deletions

View File

@@ -25,14 +25,17 @@ public static class DeleteCar
.Where(x => x.Id == new CarId(id))
.ExecuteDeleteAsync(cancellationToken);
if (rows == 0)
{
return TypedResults.NotFound();
}
if (rows > 1)
{
var logger = loggerFactory.CreateLogger(nameof(DeleteCar));
logger.LogWarning("Deleted '{DeletedRowCount}' rows for id '{CarId}'", rows, id);
}
return rows > 0
? TypedResults.NoContent()
: TypedResults.NotFound();
return TypedResults.NoContent();
}
}