protected virtual void ComponentParentNoSetterToField(IModelInspector modelInspector, PropertyPath member, IComponentAttributesMapper componentMapper)
		{
			System.Type componentType = member.LocalMember.GetPropertyOrFieldType();
			IEnumerable<MemberInfo> persistentProperties =
				MembersProvider.GetComponentMembers(componentType).Where(p => ModelInspector.IsPersistentProperty(p));

			MemberInfo parentReferenceProperty = GetComponentParentReferenceProperty(persistentProperties, member.LocalMember.ReflectedType);
			if (parentReferenceProperty != null && MatchNoSetterProperty(parentReferenceProperty))
			{
				componentMapper.Parent(parentReferenceProperty, cp => cp.Access(Accessor.NoSetter));
			}
		}
Esempio n. 2
0
        protected virtual void ComponentParentNoSetterToField(IModelInspector modelinspector, PropertyPath member, IComponentAttributesMapper componentMapper)
        {
            System.Type componentType = member.LocalMember.GetPropertyOrFieldType();
            IEnumerable <MemberInfo> persistentProperties =
                MembersProvider.GetComponentMembers(componentType).Where(p => ModelInspector.IsPersistentProperty(p));

            MemberInfo parentReferenceProperty = GetComponentParentReferenceProperty(persistentProperties, member.LocalMember.ReflectedType);

            if (parentReferenceProperty != null && MatchNoSetterProperty(parentReferenceProperty))
            {
                componentMapper.Parent(parentReferenceProperty, cp => cp.Access(Accessor.NoSetter));
            }
        }