Exemplo n.º 1
0
 private async Task DeleteAllObjects(Election election)
 {
     if (election.Delete)
     {
         await electionRepository.Delete(UOW, election.Id);
     }
     else
     {
         foreach (Category cat in election.CategoryList)
         {
             if (cat.Delete)
             {
                 await categoryRepository.Delete(UOW, cat.Id);
             }
             else
             {
                 foreach (Ticket ticket in cat.Tickets)
                 {
                     if (ticket.Delete)
                     {
                         await ticketRepository.Delete(UOW, ticket.Id);
                     }
                 }
             }
         }
     }
 }