public void AttachPropertyToParent()

in SharpGen/Transform/PropertyBuilder.cs [112:140]


        public void AttachPropertyToParent(CsProperty property)
        {
            var parent = property.Getter?.Parent ?? property.Setter?.Parent;

            if (parent is null)
                return;

            // If mapping rule disallows properties, don't attach the property to the model.
            if (property.Getter?.AllowProperty == false || property.Setter?.AllowProperty == false)
                return;

            // If mapping rule doesn't force properties, don't attach the set-only property to the model.
            // https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property
            if (property.Getter == null && property.Setter is {AllowProperty: null or false} setter)
            {
                if (setter.AllowProperty == false)
                    ioc.Logger.Message("Method [{0}] has redundant property rule specification", setter.QualifiedName);
                return;
            }

            // Update visibility for getter and setter (set to internal)
            ReducePropertyMethodVisibility(property.Getter);
            ReducePropertyMethodVisibility(property.Setter);

            if (property.Getter != null && property.Name.StartsWith("is", StringComparison.InvariantCultureIgnoreCase))
                property.Getter.SuffixName("_");

            parent.Add(property);
        }