コード例 #1
0
 public void Post(WallEntry wallEntry)
 {
     DiscardNullObject(wallEntry);
     lock (_repo)
     {
         _repo.Add(wallEntry);
     }
 }
コード例 #2
0
 public void Put(WallEntry wallEntry)
 {
     DiscardNullObject(wallEntry);
     lock (_repo)
     {
         CheckIfExistsInRepo(wallEntry.Id);
         ReplaceIitemsInRepo(wallEntry);
     }
 }
コード例 #3
0
        private void ReplaceIitemsInRepo(WallEntry wallEntry)
        {
            var indexes = _repo.Where(q => q.Id == wallEntry.Id).Select(q => _repo.IndexOf(q)).ToArray();

            foreach (var index in indexes)
            {
                _repo[index] = wallEntry;
            }
        }
コード例 #4
0
 public async Task DeleteAsync(WallEntry wallEntry)
 {
     var response = await _httpClient.DeleteAsync(wallEntry.Id.ToString());
 }
コード例 #5
0
 public async Task UpdateAsync(WallEntry wallEntry)
 {
     var response = await _httpClient.PutAsJsonAsync("", wallEntry);
 }
コード例 #6
0
 public async Task SaveAsync(WallEntry wallEntry)
 {
     var response = await _httpClient.PostAsJsonAsync("", wallEntry);
 }