public static StixRelationshipObjects WithAllChildrenOfAssetRemoved(
            this StixRelationshipObjects SROs,
            StixId assetId)
        {
            SROs.relationships = SROs.relationships.Where((r) => r.ParentAssetId != assetId).ToArray();

            return(SROs);
        }
        public static StixDataObjects WithAllChildrenOfAssetRemoved(this StixDataObjects SDOs, StixId assetId)
        {
            SDOs.assets = SDOs.assets.Where((a) => a.id != assetId).ToArray();

            SDOs.attack_patterns = SDOs.attack_patterns.Where((aP) => aP.ParentAssetId != assetId).ToArray();

            return(SDOs);
        }
Example #3
0
 public static AttackPattern WithReferenceToParentAsset(this AttackPattern attackPattern, StixId assetId)
 {
     attackPattern.ParentAssetId = assetId;
     return(attackPattern);
 }