public async void SaveExecution(WatchedExecution watchedExecution)
        {
            if (watchedExecution.WatchedExecutionId == 0)
            {
                await _addRepo.AddAsync(watchedExecution);

                _watchedExecutions.Add(watchedExecution);
            }
            else
            {
                var insertIndex = _watchedExecutions.IndexOf(_watchedExecutions.FirstOrDefault(x => x.WatchedExecutionId == watchedExecution.WatchedExecutionId));
                RemoveById(watchedExecution.WatchedExecutionId);
                await _updateRepo.UpdateAsync(watchedExecution);

                _watchedExecutions.Insert(insertIndex, watchedExecution);
            }
        }
Example #2
0
 public async Task UpdateAsync(T entity)
 {
     await updateRepository.UpdateAsync(entity);
 }