QueryEntities() public method

public QueryEntities ( string tablename, string query ) : TableStorageListDictResponse
tablename string
query string
return TableStorageListDictResponse
Esempio n. 1
0
        public void QueryEntitiesIsSuccessful()
        {
            if (ts.ExistsEntity(test_table, test_query) == false)
            {
                CreateEntityIsSuccessful();
            }
            var ts_response = ts.QueryEntities(test_table, test_query);
            var dicts       = ts_response.list_dict_obj;

            AssertEntity(dicts);
        }
Esempio n. 2
0
        // this query expects to find just one matching entity
        public static Dictionary <string, object> QueryForSingleEntityAsDictObj(TableStorage ts, string table, string q)
        {
            var ts_response = ts.QueryEntities(table, q);
            var dicts       = ts_response.list_dict_obj;
            var dict        = new Dictionary <string, object>();

            if (dicts.Count > 0)
            {
                dict = dicts.FirstOrDefault();
            }

            if (dicts.Count > 1)
            {
                // should not happen, but...
                GenUtils.LogMsg("warning", "QueryForSingleEntity: " + table, q + ": more than one matching entity");
            }

            return(dict);
        }
Esempio n. 3
0
        // this query expects to find just one matching entity
        public static Dictionary<string, object> QueryForSingleEntityAsDictObj(TableStorage ts, string table, string q)
        {
            var ts_response = ts.QueryEntities(table, q);
            var dicts = ts_response.list_dict_obj;
            var dict = new Dictionary<string, object>();

            if (dicts.Count > 0)
                dict = dicts.FirstOrDefault();

            if (dicts.Count > 1)
                // should not happen, but...
                GenUtils.LogMsg("info", "QueryForSingleEntity: " + table, q + ": more than one matching entity");

            return dict;
        }