Esempio n. 1
0
        private static DbExpression GeneratePropertyMappingView(StoragePropertyMapping mapping, DbExpression row)
        {
            Debug.Assert(mapping is StorageScalarPropertyMapping, "Complex property mapping is not supported in function imports.");
            var scalarPropertyMapping = (StorageScalarPropertyMapping)mapping;

            return(GenerateScalarPropertyMappingView(scalarPropertyMapping.EdmProperty, scalarPropertyMapping.ColumnProperty, row));
        }
            public static string GetIdentity(StoragePropertyMapping mapping)
            {
                var scalarPropertyMapping = mapping as StorageScalarPropertyMapping;

                if (scalarPropertyMapping != null)
                {
                    return(GetIdentity(scalarPropertyMapping));
                }

                var complexPropertyMapping = mapping as StorageComplexPropertyMapping;

                if (complexPropertyMapping != null)
                {
                    return(GetIdentity(complexPropertyMapping));
                }

                var endPropertyMapping = mapping as StorageEndPropertyMapping;

                if (endPropertyMapping != null)
                {
                    return(GetIdentity(endPropertyMapping));
                }

                var conditionPropertyMapping = (StorageConditionPropertyMapping)mapping;

                return(GetIdentity(conditionPropertyMapping));
            }
        protected virtual void Visit(StoragePropertyMapping storagePropertyMapping)
        {
            // this is a switching node, so no object header and footer will be add for this node,
            // also this Visit won't add the object to the seen list

            if (storagePropertyMapping.GetType()
                == typeof(StorageComplexPropertyMapping))
            {
                Visit((StorageComplexPropertyMapping)storagePropertyMapping);
            }
            else if (storagePropertyMapping.GetType()
                     == typeof(StorageConditionPropertyMapping))
            {
                Visit((StorageConditionPropertyMapping)storagePropertyMapping);
            }
            else if (storagePropertyMapping.GetType()
                     == typeof(StorageScalarPropertyMapping))
            {
                Visit((StorageScalarPropertyMapping)storagePropertyMapping);
            }
            else
            {
                Debug.Fail(
                    String.Format(
                        CultureInfo.InvariantCulture, "Found type '{0}', did we add a new type?", storagePropertyMapping.GetType()));
            }
        }
Esempio n. 4
0
 protected override void Visit(StoragePropertyMapping storagePropertyMapping)
 {
     base.Visit(storagePropertyMapping);
 }
 internal override void RemoveProperty(StoragePropertyMapping prop)
 {
     m_properties.Remove(prop.EdmProperty.Name);
 }
 /// <summary>
 ///     Add a property mapping as a child of this complex property mapping
 /// </summary>
 /// <param name="propertyMapping"> The mapping that needs to be added </param>
 internal override void AddProperty(StoragePropertyMapping propertyMapping)
 {
     m_properties.Add(propertyMapping.EdmProperty.Name, propertyMapping);
 }
Esempio n. 7
0
 public void RemoveProperty(StoragePropertyMapping prop)
 {
     m_properties.Remove(prop);
 }
Esempio n. 8
0
 /// <summary>
 ///     Add a property mapping as a child of this mapping fragment
 /// </summary>
 /// <param name="prop"> child property mapping to be added </param>
 public void AddProperty(StoragePropertyMapping prop)
 {
     m_properties.Add(prop);
 }
Esempio n. 9
0
 internal abstract void RemoveProperty(StoragePropertyMapping propertyMapping);
Esempio n. 10
0
 internal abstract void AddProperty(StoragePropertyMapping propertyMapping);
Esempio n. 11
0
 /// <summary>
 ///     Add a property mapping as a child of End property mapping
 /// </summary>
 /// <param name="prop"> </param>
 internal void AddProperty(StoragePropertyMapping prop)
 {
     m_properties.Add(prop);
 }