protected FunctionImportEntityTypeMappingCondition(string columnName, LineInfo lineInfo)
        {
            //Contract.Requires(columnName != null);

            ColumnName = columnName;
            LineInfo = lineInfo;
        }
        internal FunctionImportMappingComposable(
            EdmFunction functionImport,
            EdmFunction targetFunction,
            List<Tuple<StructuralType, List<StorageConditionPropertyMapping>, List<StoragePropertyMapping>>> structuralTypeMappings,
            EdmProperty[] targetFunctionKeys,
            StorageMappingItemCollection mappingItemCollection,
            string sourceLocation,
            LineInfo lineInfo) 
            : base(functionImport, targetFunction)
        {
            EntityUtil.CheckArgumentNull(mappingItemCollection, "mappingItemCollection");
            Debug.Assert(functionImport.IsComposableAttribute, "functionImport.IsComposableAttribute");
            Debug.Assert(targetFunction.IsComposableAttribute, "targetFunction.IsComposableAttribute");
            Debug.Assert(functionImport.EntitySet == null || structuralTypeMappings != null, "Function import returning entities must have structuralTypeMappings.");
            Debug.Assert(structuralTypeMappings == null || structuralTypeMappings.Count > 0, "Non-null structuralTypeMappings must not be empty.");
            EdmType resultType;
            Debug.Assert(
                structuralTypeMappings != null ||
                MetadataHelper.TryGetFunctionImportReturnType<EdmType>(functionImport, 0, out resultType) && TypeSemantics.IsScalarType(resultType),
                "Either type mappings should be specified or the function import should be Collection(Scalar).");
            Debug.Assert(functionImport.EntitySet == null || targetFunctionKeys != null, "Keys must be inferred for a function import returning entities.");
            Debug.Assert(targetFunctionKeys == null || targetFunctionKeys.Length > 0, "Keys must be null or non-empty.");

            m_mappingItemCollection = mappingItemCollection;
            // We will use these parameters to target s-space function calls in the generated command tree. 
            // Since enums don't exist in s-space we need to use the underlying type.
            m_commandParameters = functionImport.Parameters.Select(p => TypeHelpers.GetPrimitiveTypeUsageForScalar(p.TypeUsage).Parameter(p.Name)).ToArray();
            m_structuralTypeMappings = structuralTypeMappings;
            m_targetFunctionKeys = targetFunctionKeys;
            m_sourceLocation = sourceLocation;
            m_lineInfo = lineInfo;
        }
 internal FunctionImportReturnTypeStructuralTypeColumn(string columnName, StructuralType type, bool isTypeOf, LineInfo lineInfo)
 {
     ColumnName = columnName;
     IsTypeOf = isTypeOf;
     Type = type;
     LineInfo = lineInfo;
 }
        internal FunctionImportEntityTypeMappingConditionValue(string columnName, XPathNavigator columnValue, LineInfo lineInfo)
            : base(columnName, lineInfo)
        {
            //Contract.Requires(columnValue != null);

            _xPathValue = columnValue;
            _convertedValues = new Memoizer<Type, object>(GetConditionValue, null);
        }
        internal FunctionImportEntityTypeMapping(
            IEnumerable<EntityType> isOfTypeEntityTypes,
            IEnumerable<EntityType> entityTypes, IEnumerable<FunctionImportEntityTypeMappingCondition> conditions,
            Collection<FunctionImportReturnTypePropertyMapping> columnsRenameList,
            LineInfo lineInfo)
            : base(columnsRenameList, lineInfo)
        {
            //Contract.Requires(isOfTypeEntityTypes != null);
            //Contract.Requires(entityTypes != null);
            //Contract.Requires(conditions != null);

            IsOfTypeEntityTypes = new ReadOnlyCollection<EntityType>(isOfTypeEntityTypes.ToList());
            EntityTypes = new ReadOnlyCollection<EntityType>(entityTypes.ToList());
            Conditions = new ReadOnlyCollection<FunctionImportEntityTypeMappingCondition>(conditions.ToList());
        }
 internal FunctionImportEntityTypeMappingConditionIsNull(string columnName, bool isNull, LineInfo lineInfo)
     : base(columnName, lineInfo)
 {
     this.IsNull = isNull;
 }
 internal FunctionImportEntityTypeMappingConditionValue(string columnName, XPathNavigator columnValue, LineInfo lineInfo)
     : base(columnName, lineInfo)
 {
     this._xPathValue      = EntityUtil.CheckArgumentNull(columnValue, "columnValue");
     this._convertedValues = new Memoizer <Type, object>(this.GetConditionValue, null);
 }
 protected FunctionImportEntityTypeMappingCondition(string columnName, LineInfo lineInfo)
 {
     this.ColumnName = EntityUtil.CheckArgumentNull(columnName, "columnName");
     this.LineInfo   = lineInfo;
 }
 internal FunctionImportStructuralTypeMapping(
     Collection<FunctionImportReturnTypePropertyMapping> columnsRenameList, LineInfo lineInfo)
 {
     ColumnsRenameList = columnsRenameList;
     LineInfo = lineInfo;
 }
 internal FunctionImportComplexTypeMapping(
     ComplexType returnType, Collection<FunctionImportReturnTypePropertyMapping> columnsRenameList, LineInfo lineInfo)
     : base(columnsRenameList, lineInfo)
 {
     ReturnType = returnType;
 }