private async Task <DataServiceResponse> PostNewEntityAsync(Uri address, string entitySetName, CollectionProperty_Entity entity) { var context = WriterClient(address, ODataProtocolVersion.V4); context.AddObject(entitySetName, entity); return(await context.SaveChangesAsync()); }
private async Task <DataServiceResponse> UpdateEntityAsync(Uri address, string entitySetName, CollectionProperty_Entity entity, Action <CollectionProperty_Entity> update) { var context = WriterClient(address, ODataProtocolVersion.V4); context.AttachTo(entitySetName, entity); update(entity); context.UpdateObject(entity); return(await context.SaveChangesAsync()); }