Microsoft.Azure.Commands.Sql.ThreatDetection.Model.BaseThreatDetectionPolicyModel.ProcessExcludedDetectionTypes C# (CSharp) Method

ProcessExcludedDetectionTypes() public static method

In cases where the user decided to use the shortcut NONE, this method sets the value of the ExcludedDetectionType property to reflect the correct values.
public static ProcessExcludedDetectionTypes ( DetectionType excludedDetectionTypes ) : DetectionType[]
excludedDetectionTypes DetectionType
return DetectionType[]
        public static DetectionType[] ProcessExcludedDetectionTypes(DetectionType[] excludedDetectionTypes)
        {
            if (excludedDetectionTypes == null || excludedDetectionTypes.Length == 0)
            {
                return excludedDetectionTypes;
            }

            if (excludedDetectionTypes.Length == 1)
            {
                if (excludedDetectionTypes[0] == DetectionType.None)
                {
                    return new DetectionType[] { };
                }
            }
            else
            {
                if (excludedDetectionTypes.Contains(DetectionType.None))
                {
                    throw new Exception(string.Format(Properties.Resources.InvalidExcludedDetectionTypeSet, DetectionType.None));
                }
            }
            return excludedDetectionTypes;
        }