Example #1
0
 public async Task SaveItemAsync(TItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException(nameof(item));
     }
     var url = item.Id == 0 ? _urlBuilder.Build() : _urlBuilder.Build(item.Id);
     await _next.SaveItemAsync(url, item);
 }
Example #2
0
 public async Task DeleteItemAsync(int id)
 {
     if (id < 1)
     {
         throw new ArgumentOutOfRangeException(nameof(id));
     }
     var url = _urlBuilder.Build(id);
     await _next.DeleteItemAsync(url);
 }
        public async Task <TItem> ReadItemAsync(int id)
        {
            if (id < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(id));
            }
            var url = _urlBuilder.Build(id);

            return(await _next.ReadItemAsync(url));
        }