public async virtual Task <long> GetCountAsync(ICriterion filter)
        {
            var q = new RolePermissionsCountGetQuery();

            q.Filter = RolePermissionProxyUtils.GetFilterQueryValueString(filter);
            var req = new RolePermissionsCountGetRequest();

            req.Query = q;
            var resp = await _ramlClient.RolePermissionsCount.Get(req);

            RolePermissionProxyUtils.ThrowOnHttpResponseError(resp);
            return(long.Parse(await resp.RawContent.ReadAsStringAsync()));
        }
        public async Task <IEnumerable <IRolePermissionState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IRolePermissionState> states = null;
            var q = new RolePermissionsGetQuery();

            q.FirstResult = firstResult;
            q.MaxResults  = maxResults;
            q.Sort        = RolePermissionProxyUtils.GetOrdersQueryValueString(orders);
            q.Fields      = RolePermissionProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator);
            q.Filter      = RolePermissionProxyUtils.GetFilterQueryValueString(filter);
            var req = new RolePermissionsGetRequest();

            req.Query = q;
            var resp = await _ramlClient.RolePermissions.Get(req);

            RolePermissionProxyUtils.ThrowOnHttpResponseError(resp);
            states = resp.Content;
            return(states);
        }