public async virtual Task <long> GetCountAsync(ICriterion filter) { var q = new PermissionsCountGetQuery(); q.Filter = PermissionProxyUtils.GetFilterQueryValueString(filter); var req = new PermissionsCountGetRequest(); req.Query = q; var resp = await _ramlClient.PermissionsCount.Get(req); PermissionProxyUtils.ThrowOnHttpResponseError(resp); return(long.Parse(await resp.RawContent.ReadAsStringAsync())); }
public async Task <IEnumerable <IPermissionState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IPermissionState> states = null; var q = new PermissionsGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = PermissionProxyUtils.GetOrdersQueryValueString(orders); q.Fields = PermissionProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = PermissionProxyUtils.GetFilterQueryValueString(filter); var req = new PermissionsGetRequest(); req.Query = q; var resp = await _ramlClient.Permissions.Get(req); PermissionProxyUtils.ThrowOnHttpResponseError(resp); states = resp.Content; return(states); }