public async Task WhenAsync(MergePatchRoleDto c) { var idObj = (c as IMergePatchRole).RoleId; var uriParameters = new RoleUriParameters(); uriParameters.Id = idObj; var req = new RolePatchRequest(uriParameters, (MergePatchRoleDto)c); var resp = await _ramlClient.Role.Patch(req); RoleProxyUtils.ThrowOnHttpResponseError(resp); }
public async virtual Task <long> GetCountAsync(ICriterion filter) { var q = new RolesCountGetQuery(); q.Filter = RoleProxyUtils.GetFilterQueryValueString(filter); var req = new RolesCountGetRequest(); req.Query = q; var resp = await _ramlClient.RolesCount.Get(req); RoleProxyUtils.ThrowOnHttpResponseError(resp); return(long.Parse(await resp.RawContent.ReadAsStringAsync())); }
public async Task <IRoleStateEvent> GetStateEventAsync(string roleId, long version) { var idObj = roleId; var uriParameters = new RoleStateEventUriParameters(); uriParameters.Id = idObj; uriParameters.Version = version.ToString(); var req = new RoleStateEventGetRequest(uriParameters); var resp = await _ramlClient.RoleStateEvent.Get(req); RoleProxyUtils.ThrowOnHttpResponseError(resp); return(resp.Content); }
public async Task <IRoleState> GetAsync(string roleId) { IRoleState state = null; var idObj = roleId; var uriParameters = new RoleUriParameters(); uriParameters.Id = idObj; var req = new RoleGetRequest(uriParameters); var resp = await _ramlClient.Role.Get(req); RoleProxyUtils.ThrowOnHttpResponseError(resp); state = resp.Content; return(state); }
public async Task <IEnumerable <IRoleState> > GetAsync(ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IRoleState> states = null; var q = new RolesGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = RoleProxyUtils.GetOrdersQueryValueString(orders); q.Fields = RoleProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.Filter = RoleProxyUtils.GetFilterQueryValueString(filter); var req = new RolesGetRequest(); req.Query = q; var resp = await _ramlClient.Roles.Get(req); RoleProxyUtils.ThrowOnHttpResponseError(resp); states = resp.Content; return(states); }
public async Task WhenAsync(DeleteRoleDto c) { var idObj = (c as IDeleteRole).RoleId; var uriParameters = new RoleUriParameters(); uriParameters.Id = idObj; var q = new RoleDeleteQuery(); q.CommandId = c.CommandId; q.RequesterId = c.RequesterId; q.Version = Convert.ToString(c.Version); var req = new RoleDeleteRequest(uriParameters); req.Query = q; var resp = await _ramlClient.Role.Delete(req); RoleProxyUtils.ThrowOnHttpResponseError(resp); }