Make code more understandable
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user