예제 #1
0
        /// <summary>
        ///     DiscriminatedCollectionColumnMap
        /// </summary>
        /// <param name="columnMap"> </param>
        /// <param name="replacementVarMap"> </param>
        /// <returns> </returns>
        internal override ColumnMap Visit(DiscriminatedCollectionColumnMap columnMap, VarMap replacementVarMap)
        {
            var newElementColumnMap = columnMap.Element.Accept(this, replacementVarMap);
            var newDiscriminator    = (SimpleColumnMap)columnMap.Discriminator.Accept(this, replacementVarMap);
            var newKeys             = VisitList(columnMap.Keys, replacementVarMap);
            var newForeignKeys      = VisitList(columnMap.ForeignKeys, replacementVarMap);

            return(new DiscriminatedCollectionColumnMap(
                       columnMap.Type, columnMap.Name, newElementColumnMap, newKeys, newForeignKeys, newDiscriminator, columnMap.DiscriminatorValue));
        }
예제 #2
0
        internal override ColumnMap Visit(
            DiscriminatedCollectionColumnMap columnMap,
            VarMap replacementVarMap)
        {
            ColumnMap       elementMap    = columnMap.Element.Accept <ColumnMap, VarMap>((ColumnMapVisitorWithResults <ColumnMap, VarMap>) this, replacementVarMap);
            SimpleColumnMap discriminator = (SimpleColumnMap)columnMap.Discriminator.Accept <ColumnMap, VarMap>((ColumnMapVisitorWithResults <ColumnMap, VarMap>) this, replacementVarMap);

            SimpleColumnMap[] keys        = this.VisitList <SimpleColumnMap>(columnMap.Keys, replacementVarMap);
            SimpleColumnMap[] foreignKeys = this.VisitList <SimpleColumnMap>(columnMap.ForeignKeys, replacementVarMap);
            return((ColumnMap) new DiscriminatedCollectionColumnMap(columnMap.Type, columnMap.Name, elementMap, keys, foreignKeys, discriminator, columnMap.DiscriminatorValue));
        }
예제 #3
0
            /// <summary>
            ///     DiscriminatedCollectionColumnMap
            /// </summary>
            internal override void Visit(DiscriminatedCollectionColumnMap columnMap, Dump dumper)
            {
                using (new AutoXml(dumper, "DiscriminatedCollection", GetAttributes(columnMap)))
                {
                    var attrs = new Dictionary <string, object>();
                    attrs.Add("Value", columnMap.DiscriminatorValue);

                    using (new AutoXml(dumper, "discriminator", attrs))
                    {
                        columnMap.Discriminator.Accept(this, dumper);
                    }
                    DumpCollection(columnMap, dumper);
                }
            }
예제 #4
0
 internal override void Visit(DiscriminatedCollectionColumnMap columnMap, Dump dumper)
 {
     using (new Dump.AutoXml(dumper, "DiscriminatedCollection", Dump.ColumnMapDumper.GetAttributes((ColumnMap)columnMap)))
     {
         using (new Dump.AutoXml(dumper, "discriminator", new Dictionary <string, object>()
         {
             {
                 "Value",
                 columnMap.DiscriminatorValue
             }
         }))
             columnMap.Discriminator.Accept <Dump>((ColumnMapVisitor <Dump>) this, dumper);
         this.DumpCollection((CollectionColumnMap)columnMap, dumper);
     }
 }