@@ -68,9 +68,9 @@ private bool IsImplementation(Rule rule, ModellingConnection conn)
6868 isImpl &= IsNwImplementation ( rule . Froms , conn . SourceAppServers , conn . SourceAppRoles , conn . SourceAreas , conn . SourceOtherGroups , disregardedFroms ) ;
6969 isImpl &= IsNwImplementation ( rule . Tos , conn . DestinationAppServers , conn . DestinationAppRoles , conn . DestinationAreas , conn . DestinationOtherGroups , disregardedTos ) ;
7070 isImpl &= IsSvcImplementation ( rule . Services , conn . Services , conn . ServiceGroups , disregardedServices ) ;
71- rule . DisregardedFroms = disregardedFroms . ToArray ( ) ;
72- rule . DisregardedTos = disregardedTos . ToArray ( ) ;
73- rule . DisregardedServices = disregardedServices . ToArray ( ) ;
71+ rule . DisregardedFroms = [ .. disregardedFroms ] ;
72+ rule . DisregardedTos = [ .. disregardedTos ] ;
73+ rule . DisregardedServices = [ .. disregardedServices ] ;
7474 }
7575 else if ( isImpl )
7676 {
@@ -101,7 +101,7 @@ private bool IsNwImplementation(NetworkLocation[] networkLocations, List<Modelli
101101 }
102102 isImpl = false ;
103103 }
104- return ( ruleRecognitionOption . NwResolveGroup ? true : CompareRemainingNwGroups ( networkLocations , appRoles , otherGroups , disregardedLocations ) ) && isImpl ;
104+ return ( ruleRecognitionOption . NwResolveGroup || CompareRemainingNwGroups ( networkLocations , appRoles , otherGroups , disregardedLocations ) ) && isImpl ;
105105 }
106106
107107 private bool CompareNwAreas ( NetworkLocation [ ] networkLocations , List < ModellingNetworkAreaWrapper > areas , List < NetworkLocation > disregardedLocations )
@@ -149,8 +149,8 @@ private bool CompareNwObjects(List<NetworkObject> allModGroups, List<NetworkObje
149149 {
150150 if ( FullAnalysis )
151151 {
152- List < NetworkObject > disregardedGroups = allModGroups . Except ( allProdGroups , comparer ) . ToList ( ) ;
153- List < NetworkObject > surplusGroups = allProdGroups . Except ( allModGroups , comparer ) . ToList ( ) ;
152+ List < NetworkObject > disregardedGroups = [ .. allModGroups . Except ( allProdGroups , comparer ) ] ;
153+ List < NetworkObject > surplusGroups = [ .. allProdGroups . Except ( allModGroups , comparer ) ] ;
154154 foreach ( var obj in surplusGroups )
155155 {
156156 NetworkLocation ? extLoc = networkLocations . FirstOrDefault ( n => n . Object . Id == obj . Id ) ;
@@ -179,18 +179,18 @@ private bool IsSvcImplementation(ServiceWrapper[] networkServices, List<Modellin
179179 }
180180 isImpl = false ;
181181 }
182- return ( ruleRecognitionOption . SvcResolveGroup ? true : CompareSvcGroups ( networkServices , serviceGroups , disregardedServices ) ) && isImpl ;
182+ return ( ruleRecognitionOption . SvcResolveGroup || CompareSvcGroups ( networkServices , serviceGroups , disregardedServices ) ) && isImpl ;
183183 }
184184
185185 private bool CompareServices ( ServiceWrapper [ ] networkServices , List < ModellingServiceWrapper > services , List < ModellingServiceGroupWrapper > serviceGroups , List < NetworkService > disregardedServices )
186186 {
187- List < NetworkService > allProdServices = networkServices . Where ( s => s . Content . Type . Name != ServiceType . Group ) . ToList ( ) . ConvertAll ( s => s . Content ) . ToList ( ) ;
187+ List < NetworkService > allProdServices = [ .. networkServices . Where ( s => s . Content . Type . Name != ServiceType . Group ) . ToList ( ) . ConvertAll ( s => s . Content ) ] ;
188188 List < NetworkService > allModServices = ModellingServiceWrapper . Resolve ( services ) . ToList ( ) . ConvertAll ( s => ModellingService . ToNetworkService ( s ) ) ;
189189 if ( ruleRecognitionOption . SvcResolveGroup )
190190 {
191191 foreach ( var svc in networkServices . Where ( n => n . Content . Type . Name == ServiceType . Group ) . ToList ( ) . ConvertAll ( s => s . Content ) . ToList ( ) )
192192 {
193- allProdServices . AddRange ( [ .. svc . ServiceGroupFlats . ToList ( ) . ConvertAll ( g => g . Object ) ] ) ;
193+ allProdServices . AddRange ( [ .. svc . ServiceGroupFlats . ToList ( ) . ConvertAll ( g => g . Object ?? new ( ) ) ] ) ;
194194 }
195195 foreach ( var svcGrp in ModellingServiceGroupWrapper . Resolve ( serviceGroups ) )
196196 {
@@ -202,7 +202,7 @@ private bool CompareServices(ServiceWrapper[] networkServices, List<ModellingSer
202202
203203 private bool CompareSvcGroups ( ServiceWrapper [ ] networkServices , List < ModellingServiceGroupWrapper > serviceGroups , List < NetworkService > disregardedServices )
204204 {
205- List < NetworkService > allProdSvcGroups = networkServices . Where ( n => n . Content . Type . Name == ServiceType . Group ) . ToList ( ) . ConvertAll ( s => s . Content ) . ToList ( ) ;
205+ List < NetworkService > allProdSvcGroups = [ .. networkServices . Where ( n => n . Content . Type . Name == ServiceType . Group ) . ToList ( ) . ConvertAll ( s => s . Content ) ] ;
206206 List < NetworkService > allModSvcGroups = ModellingServiceGroupWrapper . Resolve ( serviceGroups ) . ToList ( ) . ConvertAll ( a => a . ToNetworkServiceGroup ( ) ) ;
207207 return CompareSvcObjects ( allModSvcGroups , allProdSvcGroups , networkServices , disregardedServices , networkServiceGroupComparer ) ;
208208 }
@@ -212,8 +212,8 @@ private bool CompareSvcObjects(List<NetworkService> allModGroups, List<NetworkSe
212212 {
213213 if ( FullAnalysis )
214214 {
215- List < NetworkService > disregardedGroups = allModGroups . Except ( allProdGroups , comparer ) . ToList ( ) ;
216- List < NetworkService > surplusGroups = allProdGroups . Except ( allModGroups , comparer ) . ToList ( ) ;
215+ List < NetworkService > disregardedGroups = [ .. allModGroups . Except ( allProdGroups , comparer ) ] ;
216+ List < NetworkService > surplusGroups = [ .. allProdGroups . Except ( allModGroups , comparer ) ] ;
217217 foreach ( var svc in surplusGroups )
218218 {
219219 ServiceWrapper ? exSvc = networkServices . FirstOrDefault ( n => n . Content . Id == svc . Id ) ;
0 commit comments