コード例 #1
0
        public async Task DeleteAsync(TEntity entity, CancellationToken ct = default)
        {
            Guard.NotNull(entity, nameof(entity));

            await DeleteAsync(entity.Id, ct);
        }
コード例 #2
0
        public Task <TEntity> ChangeStatusAsync(TEntity entity, string status, CancellationToken ct = default)
        {
            Guard.NotNull(entity, nameof(entity));

            return(ChangeStatusAsync(entity.Id, status, ct));
        }
コード例 #3
0
        public Task DeleteAsync(string id, CancellationToken ct = default)
        {
            Guard.NotNullOrEmpty(id, nameof(id));

            return(RequestAsync(HttpMethod.Delete, BuildSchemaUrl($"{id}/", false), ct: ct));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        public Task <TEntity> PatchAsync <TPatch>(TEntity entity, TPatch patch, CancellationToken ct = default)
        {
            Guard.NotNull(entity, nameof(entity));

            return(PatchAsync(entity.Id, patch, ct));
        }
コード例 #6
0
        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));
        }
コード例 #7
0
        public Task <TEntity> UpdateAsync(TEntity entity, CancellationToken ct = default)
        {
            Guard.NotNull(entity, nameof(entity));

            return(UpdateAsync(entity.Id, entity.Data, ct));
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        public Task <TEntity> DeleteDraftAsync(TEntity entity, CancellationToken ct = default)
        {
            Guard.NotNull(entity, nameof(entity));

            return(DeleteDraftAsync(entity.Id, ct));
        }
コード例 #10
0
        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));
        }
コード例 #11
0
        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));
        }
コード例 #12
0
        public Task DeleteAsync(string id)
        {
            Guard.NotNullOrEmpty(id, nameof(id));

            return(RequestAsync(HttpMethod.Delete, $"{id}/"));
        }
コード例 #13
0
        public Task RestoreAsync(string id)
        {
            Guard.NotNullOrEmpty(id, nameof(id));

            return(RequestAsync(HttpMethod.Put, $"{id}/restore/"));
        }
コード例 #14
0
        public Task UnpublishAsync(string id)
        {
            Guard.NotNullOrEmpty(id, nameof(id));

            return(RequestAsync(HttpMethod.Put, $"{id}/unpublish/"));
        }