Exemple #1
0
 private static void DeleteEntities <T>(MediaClient mediaClient, MediaEntity entityType) where T : Resource
 {
     T[] entities = mediaClient.GetAllEntities <T>(entityType);
     foreach (T entity in entities)
     {
         if (!entity.Name.StartsWith(Constant.Media.PredefinedPrefix))
         {
             if (entityType == MediaEntity.Transform)
             {
                 Job[] jobs = mediaClient.GetAllEntities <Job>(MediaEntity.TransformJob, null, entity.Name);
                 foreach (Job job in jobs)
                 {
                     mediaClient.DeleteEntity(MediaEntity.TransformJob, job.Name, entity.Name);
                 }
             }
             mediaClient.DeleteEntity(entityType, entity.Name);
         }
     }
 }
Exemple #2
0
 private static void DeleteEntities <T>(MediaClient mediaClient, MediaEntity entityType) where T : Resource
 {
     T[] entities = mediaClient.GetAllEntities <T>(entityType);
     foreach (T entity in entities)
     {
         if (!entity.Name.StartsWith(Constant.Media.PredefinedPrefix, StringComparison.OrdinalIgnoreCase))
         {
             mediaClient.DeleteEntity(entityType, entity.Name);
         }
     }
 }