Bug Description
IServiceManager mixes async write operations (Task<bool>) with synchronous read operations in the same interface. This creates an inconsistent API surface — callers must switch between async and sync calling patterns depending on which method they use.
Actual Behavior
// IServiceManager.cs
// Async write operations (lines 24-54):
Task<bool> InstallService(...);
Task<bool> UninstallService(...);
Task<bool> StartService(...);
Task<bool> StopService(...);
Task<bool> RestartService(...);
// Sync read operations (lines 62-104):
ServiceControllerStatus GetServiceStatus(...);
bool IsServiceInstalled(...);
ServiceStartType? GetServiceStartupType(...);
List<ServiceInfo> GetAllServices(...);
ServiceDependencyNode? GetDependencies(...);
The repository layer (IServiceRepository) offers both sync and async variants for similar operations (e.g. GetByName + GetByNameAsync), but IServiceManager only provides sync versions for reads.
Expected Behavior
Either provide async versions for read operations as well, or document the design decision for keeping reads synchronous (e.g. because ServiceController API is inherently synchronous).
Environment
- File:
src/Servy.Core/Services/IServiceManager.cs
- Lines: 24-104
Bug Description
IServiceManagermixes async write operations (Task<bool>) with synchronous read operations in the same interface. This creates an inconsistent API surface — callers must switch between async and sync calling patterns depending on which method they use.Actual Behavior
The repository layer (
IServiceRepository) offers both sync and async variants for similar operations (e.g.GetByName+GetByNameAsync), butIServiceManageronly provides sync versions for reads.Expected Behavior
Either provide async versions for read operations as well, or document the design decision for keeping reads synchronous (e.g. because
ServiceControllerAPI is inherently synchronous).Environment
src/Servy.Core/Services/IServiceManager.cs