Esempio n. 1
0
 private async Task DeleteItem(TItem item)
 {
     await HttpHelper.SendHttpMessageWithSetSaving(
         $"{typeof(TItem).Name}-DeleteItem",
         () => _http.DeleteAsync($"{Url}/{item.Id}"),
         null,
         tuple => SetSaving.InvokeAsync(tuple));
 }
Esempio n. 2
0
        private async Task UploadNewItem(TItem item)
        {
            JsonSerializerSettings serializerOptions = new() { TypeNameHandling = TypeNameHandling.Auto };
            StringContent          content           = ItemToStringContent(item, serializerOptions);

            await HttpHelper.SendHttpMessageWithSetSaving(
                $"{typeof(TItem).Name}-UploadNew",
                () => _http.PutAsync(Url, content),
                async response => await OnUploadItemSuccess(response, item, serializerOptions),
                tuple => SetSaving.InvokeAsync(tuple));
        }