public async Task DeleteAsync(TEntity entity, CancellationToken ct = default) { Guard.NotNull(entity, nameof(entity)); await DeleteAsync(entity.Id, ct); }
public Task <TEntity> ChangeStatusAsync(TEntity entity, string status, CancellationToken ct = default) { Guard.NotNull(entity, nameof(entity)); return(ChangeStatusAsync(entity.Id, status, ct)); }
public Task DeleteAsync(string id, CancellationToken ct = default) { Guard.NotNullOrEmpty(id, nameof(id)); return(RequestAsync(HttpMethod.Delete, BuildSchemaUrl($"{id}/", false), ct: ct)); }
public Task <List <BulkResult> > BulkUpdateAsync(BulkUpdate update, CancellationToken ct = default) { Guard.NotNull(update, nameof(update)); return(RequestJsonAsync <List <BulkResult> >(HttpMethod.Post, BuildSchemaUrl("bulk", false), update.ToContent(), ct: ct)); }
public Task <TEntity> PatchAsync <TPatch>(TEntity entity, TPatch patch, CancellationToken ct = default) { Guard.NotNull(entity, nameof(entity)); return(PatchAsync(entity.Id, patch, ct)); }
public Task <TEntity> UpsertAsync(TEntity entity, bool publish = false, CancellationToken ct = default) { Guard.NotNull(entity, nameof(entity)); return(UpsertAsync(entity.Id, entity.Data, publish, ct)); }
public Task <TEntity> UpdateAsync(TEntity entity, CancellationToken ct = default) { Guard.NotNull(entity, nameof(entity)); return(UpdateAsync(entity.Id, entity.Data, ct)); }
public Task <TEntity> DeleteDraftAsync(string id, CancellationToken ct = default) { Guard.NotNullOrEmpty(id, nameof(id)); return(RequestJsonAsync <TEntity>(HttpMethod.Delete, BuildSchemaUrl($"{id}/draft", false), ct: ct)); }
public Task <TEntity> DeleteDraftAsync(TEntity entity, CancellationToken ct = default) { Guard.NotNull(entity, nameof(entity)); return(DeleteDraftAsync(entity.Id, ct)); }
public Task <TEntity> CreateAsync(TData data, string id, bool publish = false, CancellationToken ct = default) { Guard.NotNull(data, nameof(data)); return(RequestJsonAsync <TEntity>(HttpMethod.Post, BuildSchemaUrl($"?publish={publish}&id={id ?? string.Empty}", false), data.ToContent(), ct: ct)); }
public Task <TEntity> GetAsync(string id, QueryContext context = null, CancellationToken ct = default) { Guard.NotNullOrEmpty(id, nameof(id)); return(RequestJsonAsync <TEntity>(HttpMethod.Get, BuildSchemaUrl($"{id}/", true, context), null, context, ct)); }
public Task DeleteAsync(string id) { Guard.NotNullOrEmpty(id, nameof(id)); return(RequestAsync(HttpMethod.Delete, $"{id}/")); }
public Task RestoreAsync(string id) { Guard.NotNullOrEmpty(id, nameof(id)); return(RequestAsync(HttpMethod.Put, $"{id}/restore/")); }
public Task UnpublishAsync(string id) { Guard.NotNullOrEmpty(id, nameof(id)); return(RequestAsync(HttpMethod.Put, $"{id}/unpublish/")); }