public async Task UpdateAsync(ExcelRowDto excelRowDto)
 {
     excelRowDto.ModifiedDate = DateTime.Now;
     if (excelRowDto != null)
     {
         if (_excel1Repository.AnyAsync(x => x.Id == excelRowDto.Id).Result)
         {
             var excelModel1 = _autoMapper.Map <ExcelModel1>(excelRowDto);
             await _excel1Repository.UpdateAsyn(excelModel1, excelRowDto.Id);
         }
         else if (_excel2Repository.AnyAsync(x => x.Id == excelRowDto.Id).Result)
         {
             var excelModel2 = _autoMapper.Map <ExcelModel2>(excelRowDto);
             await _excel2Repository.UpdateAsyn(excelModel2, excelRowDto.Id);
         }
         else
         {
             throw new Exception($"Id {excelRowDto.Id} not found");
         }
     }
     else
     {
         throw new Exception("excelRowDto is null");
     }
 }
Exemple #2
0
 public virtual async Task <bool> AnyAsync(Func <TEntity, bool> search)
 {
     return(await _repository.AnyAsync(search));
 }