Exemplo n.º 1
0
    public async Task <JArray> GetScopes()
    {
        var sqlProvider        = new SqlSyncProvider(this.configuration.GetConnectionString("SqlConnection"));
        var remoteOrchestrator = new RemoteOrchestrator(sqlProvider);

        var scopes = await remoteOrchestrator.GetAllServerScopesInfoAsync().ConfigureAwait(false);

        var jArray = new JArray();

        foreach (var scope in scopes)
        {
            jArray.Add(new JObject {
                { "name", scope.Name },
                { "setup", JObject.FromObject(scope.Setup) },
                { "lastsync", scope.LastCleanupTimestamp },
                { "version", scope.Version },
            });
        }

        return(jArray);
    }