Example #1
0
 public SlimNavigation(
     string name,
     Type clrType,
     PropertyInfo?propertyInfo,
     FieldInfo?fieldInfo,
     SlimForeignKey foreignKey,
     PropertyAccessMode propertyAccessMode,
     bool eagerLoaded)
     : base(name, propertyInfo, fieldInfo, propertyAccessMode)
 {
     ClrType    = clrType;
     ForeignKey = foreignKey;
     if (eagerLoaded)
     {
         SetAnnotation(CoreAnnotationNames.EagerLoaded, true);
     }
 }
        public SlimSkipNavigation(
            string name,
            Type clrType,
            PropertyInfo?propertyInfo,
            FieldInfo?fieldInfo,
            SlimEntityType declaringEntityType,
            SlimEntityType targetEntityType,
            SlimForeignKey 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 <SlimSkipNavigation>(SkipNavigationComparer.Instance)
                {
                    this
                };
            }
            else
            {
                foreignKey.ReferencingSkipNavigations.Add(this);
            }

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