ServiceClientGenerator.CustomizationsModel.UseNullable C# (CSharp) Method

UseNullable() public method

Determines if the property has a customization to be set to nullable
public UseNullable ( string shapeName, string propertyName ) : bool
shapeName string The name of the shape the property is in
propertyName string The name of the property
return bool
        public bool UseNullable(string shapeName, string propertyName)
        {
            var data = _documentRoot[UseNullableTypeKey];
            if (data == null)
                return false;

            var shape = data[shapeName] as JsonData;
            if (shape == null || !shape.IsArray)
                return false;

            foreach (var name in shape)
            {
                if (string.Equals(name.ToString(), propertyName))
                    return true;
            }
            return false;
        }