File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed
src/ResourceManager/Network/Commands.Network/NetworkSecurityGroup/NetworkSecurityRule Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -46,22 +46,22 @@ public override void Execute()
46
46
throw new ArgumentException ( "Rule with the specified name already exists" ) ;
47
47
}
48
48
49
- if ( ! string . IsNullOrWhiteSpace ( this . SourceAddressPrefix ) && ( this . SourceApplicationSecurityGroup != null ) )
49
+ if ( ( this . SourceAddressPrefix != null ) && ( this . SourceAddressPrefix . Count > 0 ) && ( this . SourceApplicationSecurityGroup != null ) && ( this . SourceApplicationSecurityGroup . Count > 0 ) )
50
50
{
51
51
throw new ArgumentException ( $ "{ nameof ( SourceAddressPrefix ) } and { nameof ( SourceApplicationSecurityGroup ) } cannot be used simultaneously.") ;
52
52
}
53
53
54
- if ( ! string . IsNullOrWhiteSpace ( this . SourceAddressPrefix ) && ( this . SourceApplicationSecurityGroupId != null ) )
54
+ if ( ( this . SourceAddressPrefix != null ) && ( this . SourceAddressPrefix . Count > 0 ) && ( this . SourceApplicationSecurityGroupId != null ) && ( this . SourceApplicationSecurityGroupId . Count > 0 ) )
55
55
{
56
56
throw new ArgumentException ( $ "{ nameof ( SourceAddressPrefix ) } and { nameof ( SourceApplicationSecurityGroupId ) } cannot be used simultaneously.") ;
57
57
}
58
58
59
- if ( ! string . IsNullOrWhiteSpace ( this . DestinationAddressPrefix ) && ( this . DestinationApplicationSecurityGroup != null ) )
59
+ if ( ( this . DestinationAddressPrefix != null ) && ( this . DestinationAddressPrefix . Count > 0 ) && ( this . DestinationApplicationSecurityGroup != null ) && ( this . DestinationApplicationSecurityGroup . Count > 0 ) )
60
60
{
61
61
throw new ArgumentException ( $ "{ nameof ( DestinationAddressPrefix ) } and { nameof ( DestinationApplicationSecurityGroup ) } cannot be used simultaneously.") ;
62
62
}
63
63
64
- if ( ! string . IsNullOrWhiteSpace ( this . DestinationAddressPrefix ) && ( this . DestinationApplicationSecurityGroupId != null ) )
64
+ if ( ( this . DestinationAddressPrefix != null ) && ( this . DestinationAddressPrefix . Count > 0 ) && ( this . DestinationApplicationSecurityGroupId != null ) && ( this . DestinationApplicationSecurityGroupId . Count > 0 ) )
65
65
{
66
66
throw new ArgumentException ( $ "{ nameof ( DestinationAddressPrefix ) } and { nameof ( DestinationApplicationSecurityGroupId ) } cannot be used simultaneously.") ;
67
67
}
Original file line number Diff line number Diff line change @@ -32,22 +32,22 @@ public override void Execute()
32
32
{
33
33
base . Execute ( ) ;
34
34
35
- if ( ! string . IsNullOrWhiteSpace ( this . SourceAddressPrefix ) && ( this . SourceApplicationSecurityGroup != null ) )
35
+ if ( ( this . SourceAddressPrefix != null ) && ( this . SourceAddressPrefix . Count > 0 ) && ( this . SourceApplicationSecurityGroup != null ) && ( this . SourceApplicationSecurityGroup . Count > 0 ) )
36
36
{
37
37
throw new ArgumentException ( $ "{ nameof ( SourceAddressPrefix ) } and { nameof ( SourceApplicationSecurityGroup ) } cannot be used simultaneously.") ;
38
38
}
39
39
40
- if ( ! string . IsNullOrWhiteSpace ( this . SourceAddressPrefix ) && ( this . SourceApplicationSecurityGroupId != null ) )
40
+ if ( ( this . SourceAddressPrefix != null ) && ( this . SourceAddressPrefix . Count > 0 ) && ( this . SourceApplicationSecurityGroupId != null ) && ( this . SourceApplicationSecurityGroupId . Count > 0 ) )
41
41
{
42
42
throw new ArgumentException ( $ "{ nameof ( SourceAddressPrefix ) } and { nameof ( SourceApplicationSecurityGroupId ) } cannot be used simultaneously.") ;
43
43
}
44
44
45
- if ( ! string . IsNullOrWhiteSpace ( this . DestinationAddressPrefix ) && ( this . DestinationApplicationSecurityGroup != null ) )
45
+ if ( ( this . DestinationAddressPrefix != null ) && ( this . DestinationAddressPrefix . Count > 0 ) && ( this . DestinationApplicationSecurityGroup != null ) && ( this . DestinationApplicationSecurityGroup . Count > 0 ) )
46
46
{
47
47
throw new ArgumentException ( $ "{ nameof ( DestinationAddressPrefix ) } and { nameof ( DestinationApplicationSecurityGroup ) } cannot be used simultaneously.") ;
48
48
}
49
49
50
- if ( ! string . IsNullOrWhiteSpace ( this . DestinationAddressPrefix ) && ( this . DestinationApplicationSecurityGroupId != null ) )
50
+ if ( ( this . DestinationAddressPrefix != null ) && ( this . DestinationAddressPrefix . Count > 0 ) && ( this . DestinationApplicationSecurityGroupId != null ) && ( this . DestinationApplicationSecurityGroupId . Count > 0 ) )
51
51
{
52
52
throw new ArgumentException ( $ "{ nameof ( DestinationAddressPrefix ) } and { nameof ( DestinationApplicationSecurityGroupId ) } cannot be used simultaneously.") ;
53
53
}
Original file line number Diff line number Diff line change @@ -38,22 +38,22 @@ public override void Execute()
38
38
{
39
39
base . Execute ( ) ;
40
40
41
- if ( ! string . IsNullOrWhiteSpace ( this . SourceAddressPrefix ) && ( this . SourceApplicationSecurityGroup != null ) )
41
+ if ( ( this . SourceAddressPrefix != null ) && ( this . SourceAddressPrefix . Count > 0 ) && ( this . SourceApplicationSecurityGroup != null ) && ( this . SourceApplicationSecurityGroup . Count > 0 ) )
42
42
{
43
43
throw new ArgumentException ( $ "{ nameof ( SourceAddressPrefix ) } and { nameof ( SourceApplicationSecurityGroup ) } cannot be used simultaneously.") ;
44
44
}
45
45
46
- if ( ! string . IsNullOrWhiteSpace ( this . SourceAddressPrefix ) && ( this . SourceApplicationSecurityGroupId != null ) )
46
+ if ( ( this . SourceAddressPrefix != null ) && ( this . SourceAddressPrefix . Count > 0 ) && ( this . SourceApplicationSecurityGroupId != null ) && ( this . SourceApplicationSecurityGroupId . Count > 0 ) )
47
47
{
48
48
throw new ArgumentException ( $ "{ nameof ( SourceAddressPrefix ) } and { nameof ( SourceApplicationSecurityGroupId ) } cannot be used simultaneously.") ;
49
49
}
50
50
51
- if ( ! string . IsNullOrWhiteSpace ( this . DestinationAddressPrefix ) && ( this . DestinationApplicationSecurityGroup != null ) )
51
+ if ( ( this . DestinationAddressPrefix != null ) && ( this . DestinationAddressPrefix . Count > 0 ) && ( this . DestinationApplicationSecurityGroup != null ) && ( this . DestinationApplicationSecurityGroup . Count > 0 ) )
52
52
{
53
53
throw new ArgumentException ( $ "{ nameof ( DestinationAddressPrefix ) } and { nameof ( DestinationApplicationSecurityGroup ) } cannot be used simultaneously.") ;
54
54
}
55
55
56
- if ( ! string . IsNullOrWhiteSpace ( this . DestinationAddressPrefix ) && ( this . DestinationApplicationSecurityGroupId != null ) )
56
+ if ( ( this . DestinationAddressPrefix != null ) && ( this . DestinationAddressPrefix . Count > 0 ) && ( this . DestinationApplicationSecurityGroupId != null ) && ( this . DestinationApplicationSecurityGroupId . Count > 0 ) )
57
57
{
58
58
throw new ArgumentException ( $ "{ nameof ( DestinationAddressPrefix ) } and { nameof ( DestinationApplicationSecurityGroupId ) } cannot be used simultaneously.") ;
59
59
}
You can’t perform that action at this time.
0 commit comments