Пример #1
0
        private bool MatchOneToMany(MemberInfo memberInfo)
        {
            var modelInspector = (IModelInspector)this;

            System.Type from = memberInfo.ReflectedType;
            System.Type to   = memberInfo.GetPropertyOrFieldType().DetermineCollectionElementOrDictionaryValueType();
            if (to == null)
            {
                // no generic collection or simple property
                return(false);
            }
            bool areEntities             = modelInspector.IsEntity(from) && modelInspector.IsEntity(to);
            bool isFromComponentToEntity = modelInspector.IsComponent(from) && modelInspector.IsEntity(to);

            return(!declaredModel.IsManyToMany(memberInfo) && (areEntities || isFromComponentToEntity));
        }