public async Task <JArray> GetClientScopes() { var sqlProvider = new SqlSyncProvider(this.configuration.GetConnectionString("SqlConnection")); var remoteOrchestrator = new RemoteOrchestrator(sqlProvider); var scopes = await remoteOrchestrator.GetAllServerScopesHistoriesInfosAsync().ConfigureAwait(false); var jArray = new JArray(); foreach (var scope in scopes) { jArray.Add(new JObject { { "id", scope.Id }, { "scopeName", scope.Name }, { "lastSync", scope.LastSync }, { "lastSyncDuration", scope.LastSyncDuration }, { "lastSyncTimestamp", scope.LastSyncTimestamp }, { "properties", scope.Properties }, }); } return(jArray); }