Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            NestedPropertyRef nestedPropertyRef = obj as NestedPropertyRef;

            if (nestedPropertyRef != null && this.m_inner.Equals((object)nestedPropertyRef.m_inner))
            {
                return(this.m_outer.Equals((object)nestedPropertyRef.m_outer));
            }
            return(false);
        }
Exemplo n.º 2
0
 internal int GetNestedStructureOffset(PropertyRef property)
 {
     for (int index = 0; index < this.m_propertyRefList.Count; ++index)
     {
         NestedPropertyRef propertyRef = this.m_propertyRefList[index] as NestedPropertyRef;
         if (propertyRef != null && propertyRef.InnerProperty.Equals((object)property))
         {
             return(index);
         }
     }
     System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(false, "no complex structure " + (object)property + " found in TypeInfo");
     return(0);
 }
Exemplo n.º 3
0
        private TypeUsage GetPropertyType(RootTypeInfo typeInfo, PropertyRef p)
        {
            TypeUsage   type        = (TypeUsage)null;
            PropertyRef propertyRef = (PropertyRef)null;

            while (p is NestedPropertyRef)
            {
                NestedPropertyRef nestedPropertyRef = (NestedPropertyRef)p;
                p           = nestedPropertyRef.OuterProperty;
                propertyRef = nestedPropertyRef.InnerProperty;
            }
            if (p is TypeIdPropertyRef)
            {
                SimplePropertyRef simplePropertyRef = (SimplePropertyRef)propertyRef;
                type = simplePropertyRef == null ? typeInfo.TypeIdType : this.GetTypeInfo(simplePropertyRef.Property.TypeUsage).RootType.TypeIdType;
            }
            else if (p is EntitySetIdPropertyRef || p is NullSentinelPropertyRef)
            {
                type = this.m_intType;
            }
            else if (p is RelPropertyRef)
            {
                type = ((RelPropertyRef)p).Property.ToEnd.TypeUsage;
            }
            else
            {
                SimplePropertyRef simplePropertyRef = p as SimplePropertyRef;
                if (simplePropertyRef != null)
                {
                    type = Helper.GetModelTypeUsage(simplePropertyRef.Property);
                }
            }
            TypeUsage newType = this.GetNewType(type);

            System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(null != newType, "unrecognized property type?");
            return(newType);
        }