public IHttpActionResult UpdateDomain(long objectId, UpdateObjectModel objectValue) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } long output = Storage.updateObject(objectId, objectValue.ownerId, objectValue.roles, objectValue.groups); return(new StatusCodeResult(HttpStatusCode.NoContent, this)); }//UpdateDomain
public static async Task <long> UpdateAsync(long objectId, long ownerId, List <objectSecurity> roles, List <objectSecurity> groups) { UpdateObjectModel fromBodyGroup = new UpdateObjectModel(); fromBodyGroup.objectId = objectId; fromBodyGroup.ownerId = ownerId; fromBodyGroup.roles = roles; fromBodyGroup.groups = groups; long output = -1; HttpResponseMessage response = await MyClient.client.PostAsJsonAsync(string.Format("security/object/{0}", objectId), fromBodyGroup); if (response.IsSuccessStatusCode) { output = await response.Content.ReadAsAsync <long>(); } return(output); }