Ejemplo n.º 1
0
        internal void Init(CosmosDBBox cosmosDb, DocumentCollection col, TypeSchema type, string text, string textEverywhere)
        {
            this.col  = col;
            this.type = type;

            gbMain.Text = string.Format($"{col.Id} - {type.ItemStorageType}");

            var where = "c.itemStorageType='" + type.ItemStorageType + "'";

            if (text.Length > 0)
            {
                foreach (var field in type.Fields)
                {
                    where = where + " or c." + field + "='" + text + "'";
                }
            }
            var documents = FrmMain.ExecuteQuery <JObject>(cosmosDb.Client, col, where);

            if (!documents.Any())
            {
                this.Visible = false;
                return;
            }

            BuildTable(documents, textEverywhere);
        }
Ejemplo n.º 2
0
        bool FindCollectionTypeSchemas(CosmosDBBox cosmosDb, DocumentCollection col, List <TypeSchema> typeSchemas)
        {
            var where = "1=1";

            foreach (var t in typeSchemas)
            {
                where = where + " and c." + TypeField + " != '" + t.ItemStorageType + "'";
            }

            var document = FrmMain.ExecuteQuery <JObject>(cosmosDb.Client, col, where).FirstOrDefault();

            if (AddTypeSchema(typeSchemas, document))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }