Wednesday, 17 July 2024

get ooutput result for foreach loop save

  public async Task<bool> BulkMovetoCompletedFiles(List<tbl_ScanedFiles> files)

 {

     try

     {

         bool result = false;

         List<bool> responseResult = new List<bool>();


         if (files.Count > 0)

         {

             foreach (var item in files)

             {

                 responseResult.Add(await MovetoCompletedFiles(item.FileName, item.DivisionName, item.CountryName));

             }


             if (responseResult.All(x => x == true))

             {

                 result = true;

             }

         }


         return result;

     }

     catch (Exception ex)

     {

         throw ex;

     }

 }

No comments:

Post a Comment

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...