public void DeleteFiles(FileCriteria criteria)
 {
     var query = _fileMetadataRepo.DbSet();
     if (criteria.Catalog != null)
     {
         query.Where(w => w.CatalogUri == criteria.Catalog);
     }
     if (criteria.KeyTags.ContainsKey("FlowInstId"))
     {
         if (criteria.KeyTags["FlowInstId"] != null)
         {
             query.Where(w => w.Propertys.Any(c => c.Name == "FlowInstId" && c.Value == criteria.KeyTags["FlowInstId"]));
         }
     }
     if (criteria.KeyTags.ContainsKey("ProjectId"))
     {
         if (criteria.KeyTags["ProjectId"] != null)
         {
             query.Where(w => w.Propertys.Any(c => c.Name == "ProjectId" && c.Value == criteria.KeyTags["ProjectId"]));
         }
     }
     if (criteria.KeyTags.ContainsKey("ReferenceId"))
     {
         if (criteria.KeyTags["ReferenceId"] != null)
         {
             query.Where(w => w.Propertys.Any(c => c.Name == "ReferenceId" && c.Value == criteria.KeyTags["ReferenceId"]));
         }
     }
     foreach (var item in query)
     {
         _fileMediaService.DelFile(item.Id);
     }
 }
 public System.Collections.Generic.List<ResoureMetadataDTO> GetFiles(FileCriteria criteria)
 {
     var query = _fileMetadataRepo.DbSet();
     if (criteria.Catalog != null)
     {
         query.Where(w => w.CatalogUri == criteria.Catalog);
     }
     if (criteria.KeyTags.ContainsKey("FlowInstId"))
     {
         if (criteria.KeyTags["FlowInstId"] != null)
         {
             query.Where(w => w.Propertys.Any(c => c.Name == "FlowInstId" && c.Value == criteria.KeyTags["FlowInstId"]));
         }
     }
     if (criteria.KeyTags.ContainsKey("ProjectId"))
     {
         if (criteria.KeyTags["ProjectId"] != null)
         {
             query.Where(w => w.Propertys.Any(c => c.Name == "ProjectId" && c.Value == criteria.KeyTags["ProjectId"]));
         }
     }
     if (criteria.KeyTags.ContainsKey("ReferenceId"))
     {
         if (criteria.KeyTags["ReferenceId"] != null)
         {
             query.Where(w => w.Propertys.Any(c => c.Name == "ReferenceId" && c.Value == criteria.KeyTags["ReferenceId"]));
         }
     }
     var list = query.ConvertToResoureMetaDataDto().ToList();
     return list;
 }