ServiceClientGenerator.CustomizationsModel.EmitIsSetProperties C# (CSharp) Method

EmitIsSetProperties() public method

Determines if the collection property can be empty when being sent to the service.
public EmitIsSetProperties ( 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 EmitIsSetProperties(string shapeName, string propertyName)
        {
            var data = _documentRoot[EmitIsSetPropertiesKey];
            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;
        }