public async Task <IEnumerable <IPartyRoleState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IPartyRoleState> states = null; var q = new PartyRolesGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = PartyRoleProxyUtils.GetOrdersQueryValueString(orders); q.Fields = PartyRoleProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = PartyRoleProxyUtils.GetFilterQueryValueString(filter); var req = new PartyRolesGetRequest(); req.Query = q; var resp = await _ramlClient.PartyRoles.Get(req); PartyRoleProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToPartyRoleState()); return(states); }