BaseWorker, BaseWorkerWithContext DoWork, call: Scope setting

TrangaBaseContext Sync return with success state and exception message
This commit is contained in:
2025-07-02 22:15:34 +02:00
parent 650cbffc8a
commit 637ad2e215
19 changed files with 125 additions and 99 deletions

View File

@@ -60,8 +60,8 @@ public class LibraryConnectorController(IServiceScope scope) : Controller
context.LibraryConnectors.Add(libraryConnector);
if(context.Sync().Result is { } errorMessage)
return StatusCode(Status500InternalServerError, errorMessage);
if(context.Sync().Result is { success: false } result)
return StatusCode(Status500InternalServerError, result.exceptionMessage);
return Created();
}
@@ -84,8 +84,8 @@ public class LibraryConnectorController(IServiceScope scope) : Controller
context.LibraryConnectors.Remove(connector);
if(context.Sync().Result is { } errorMessage)
return StatusCode(Status500InternalServerError, errorMessage);
if(context.Sync().Result is { success: false } result)
return StatusCode(Status500InternalServerError, result.exceptionMessage);
return Ok();
}
}