예제 #1
0
 public RuntimeNavigation(
     string name,
     Type clrType,
     PropertyInfo?propertyInfo,
     FieldInfo?fieldInfo,
     RuntimeForeignKey foreignKey,
     PropertyAccessMode propertyAccessMode,
     bool eagerLoaded)
     : base(name, propertyInfo, fieldInfo, propertyAccessMode)
 {
     ClrType    = clrType;
     ForeignKey = foreignKey;
     if (eagerLoaded)
     {
         SetAnnotation(CoreAnnotationNames.EagerLoaded, true);
     }
 }
예제 #2
0
        public RuntimeSkipNavigation(
            string name,
            Type clrType,
            PropertyInfo?propertyInfo,
            FieldInfo?fieldInfo,
            RuntimeEntityType declaringEntityType,
            RuntimeEntityType targetEntityType,
            RuntimeForeignKey foreignKey,
            bool collection,
            bool onDependent,
            PropertyAccessMode propertyAccessMode,
            bool eagerLoaded)
            : base(name, propertyInfo, fieldInfo, propertyAccessMode)
        {
            ClrType             = clrType;
            DeclaringEntityType = declaringEntityType;
            TargetEntityType    = targetEntityType;
            _foreignKey         = foreignKey;
            if (foreignKey.ReferencingSkipNavigations == null)
            {
                foreignKey.ReferencingSkipNavigations = new SortedSet <RuntimeSkipNavigation>(SkipNavigationComparer.Instance)
                {
                    this
                };
            }
            else
            {
                foreignKey.ReferencingSkipNavigations.Add(this);
            }

            _isCollection  = collection;
            _isOnDependent = onDependent;
            if (eagerLoaded)
            {
                SetAnnotation(CoreAnnotationNames.EagerLoaded, true);
            }
        }