Beispiel #1
0
        public static async IAsyncEnumerable <Schema> GetAllSchemas(IApiClient apiClient, Settings settings,
                                                                    int sampleSize = 5)
        {
            var allEndpoints = EndpointHelper.GetAllEndpoints();

            foreach (var endpoint in allEndpoints.Values)
            {
                // base schema to be added to
                var schema = new Schema
                {
                    Id                = endpoint.Id,
                    Name              = endpoint.Name,
                    Description       = "",
                    PublisherMetaJson = JsonConvert.SerializeObject(endpoint),
                    DataFlowDirection = endpoint.GetDataFlowDirection()
                };

                schema = await GetSchemaForEndpoint(apiClient, schema, endpoint);

                // get sample and count
                yield return(await AddSampleAndCount(apiClient, schema, sampleSize, endpoint));
            }
        }