public async Task <int> CountAsync()
        {
            if (count == null)
            {
                JObject requestParams = new JObject(parameters);
                requestParams["count"] = 1;
                JObject res = (JObject)await api.DoRequestAsync("GET", path, requestParams);

                count = (int)res["count"];
            }
            return(count.Value);
        }
示例#2
0
        public virtual async Task SaveAsync()
        {
            JObject dirtyProps = dirty;

            if (vars != null)
            {
                JObject dirtyVars = vars.getDirtyVariables();
                if (dirtyVars.Count > 0)
                {
                    dirtyProps["vars"] = dirtyVars;
                }
            }
            await api.DoRequestAsync("POST", GetBaseApiPath(), dirtyProps);

            dirty = new JObject();

            if (vars != null)
            {
                vars.ClearDirtyVariables();
            }
        }