private void SaveItem(SampleItemDto dto) { var oldDto = _itemsStorage.SingleOrDefault(x => x.Id == dto.Id); if (oldDto == null) { _itemsStorage.Add(dto); return; } oldDto.DisplayName = dto.DisplayName; oldDto.Value = dto.Value; }
public bool UpdateItem(SampleItemDto dto) { throw new NotImplementedException(); }
public void CreateItem(SampleItemDto dto) { throw new NotImplementedException(); }
void ISampleDataProvider.CreateItem(SampleItemDto dto) => GetService(r => { Task.Delay(_random.Next(2000)).Wait(); return(r); }).CreateItem(dto);