/// <summary> /// ComplexTypeColumnMap /// </summary> /// <param name="columnMap"></param> /// <param name="replacementVarMap"></param> /// <returns></returns> internal override ColumnMap Visit(ComplexTypeColumnMap columnMap, VarMap replacementVarMap) { SimpleColumnMap newNullability = columnMap.NullSentinel; if (null != newNullability) { newNullability = (SimpleColumnMap)newNullability.Accept(this, replacementVarMap); } ColumnMap[] fieldList = VisitList(columnMap.Properties, replacementVarMap); return(new ComplexTypeColumnMap(columnMap.Type, columnMap.Name, fieldList, newNullability)); }
/// <summary> /// ComplexTypeColumnMap /// </summary> /// <param name="columnMap"></param> /// <param name="dumper"></param> /// <returns></returns> internal override void Visit(ComplexTypeColumnMap columnMap, Dump dumper) { using (new AutoXml(dumper, "ComplexType", GetAttributes(columnMap))) { if (columnMap.NullSentinel != null) { using (new AutoXml(dumper, "nullSentinel")) { columnMap.NullSentinel.Accept(this, dumper); } } VisitList(columnMap.Properties, dumper); } }
internal virtual void Visit(ComplexTypeColumnMap columnMap, TArgType arg) { ColumnMap nullSentinel = columnMap.NullSentinel; if (null != nullSentinel) { nullSentinel.Accept(this, arg); } foreach (ColumnMap p in columnMap.Properties) { p.Accept(this, arg); } }
/// <summary> /// Build the collectionColumnMap from a store datareader, a type and an entitySet. /// </summary> /// <param name="storeDataReader"></param> /// <param name="edmType"></param> /// <param name="entitySet"></param> /// <returns></returns> internal static CollectionColumnMap CreateColumnMapFromReaderAndType(DbDataReader storeDataReader, EdmType edmType, EntitySet entitySet, Dictionary <string, FunctionImportReturnTypeStructuralTypeColumnRenameMapping> renameList) { Debug.Assert(Helper.IsEntityType(edmType) || null == entitySet, "The specified non-null EntitySet is incompatible with the EDM type specified."); // Next, build the ColumnMap directly from the edmType and entitySet provided. ColumnMap[] propertyColumnMaps = GetColumnMapsForType(storeDataReader, edmType, renameList); ColumnMap elementColumnMap = null; // NOTE: We don't have a null sentinel here, because the stored proc won't // return one anyway; we'll just presume the data's always there. if (Helper.IsRowType(edmType)) { elementColumnMap = new RecordColumnMap(TypeUsage.Create(edmType), edmType.Name, propertyColumnMaps, null); } else if (Helper.IsComplexType(edmType)) { elementColumnMap = new ComplexTypeColumnMap(TypeUsage.Create(edmType), edmType.Name, propertyColumnMaps, null); } else if (Helper.IsScalarType(edmType)) { if (storeDataReader.FieldCount != 1) { throw EntityUtil.CommandExecutionDataReaderFieldCountForScalarType(); } elementColumnMap = new ScalarColumnMap(TypeUsage.Create(edmType), edmType.Name, 0, 0); } else if (Helper.IsEntityType(edmType)) { elementColumnMap = CreateEntityTypeElementColumnMap(storeDataReader, edmType, entitySet, propertyColumnMaps, null /*renameList*/); } else { Debug.Assert(false, "unexpected edmType?"); } CollectionColumnMap collection = new SimpleCollectionColumnMap(edmType.GetCollectionType().TypeUsage, edmType.Name, elementColumnMap, null, null); return(collection); }
internal abstract TResultType Visit(ComplexTypeColumnMap columnMap, TArgType arg);