当前位置: 首页>>代码示例>>C#>>正文


C# HbmMapping.AsString方法代码示例

本文整理汇总了C#中NHibernate.Cfg.MappingSchema.HbmMapping.AsString方法的典型用法代码示例。如果您正苦于以下问题:C# HbmMapping.AsString方法的具体用法?C# HbmMapping.AsString怎么用?C# HbmMapping.AsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NHibernate.Cfg.MappingSchema.HbmMapping的用法示例。


在下文中一共展示了HbmMapping.AsString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapTypes

        public virtual void MapTypes(List<Type> allTypes, NHibernate.Cfg.Configuration cfg, Func<string, string> formatter)
        {
            var m = new HbmMapping();
            m.Items = allTypes.Select(t =>
                {
                    var sc = new HbmSubclass();
                    sc.name = GetName(t);
                    sc.extends = GetName(t.BaseType);
                    sc.discriminatorvalue = map.GetOrCreateDefinition(t).Discriminator ?? t.Name;
                    sc.lazy = false;
                    sc.lazySpecified = true;

                    var propertyMappings = GetPersistables(t)
                        .Select(p => p.Attribute.GetPropertyMapping(p.DeclaringProperty, formatter))
                        .ToList();
                    if (propertyMappings.Count > 0)
                    {
                        if (sc.Items == null)
                            sc.Items = propertyMappings.ToArray();
                        else
                            sc.Items = sc.Items.Union(propertyMappings).ToArray();
                    }

                    return sc;
                }).ToArray();
            var dbg = m.AsString();
            cfg.AddDeserializedMapping(m, "N2");
        }
开发者ID:amarwadi,项目名称:n2cms,代码行数:28,代码来源:ClassMappingGenerator.cs

示例2: MapTypes

		public virtual void MapTypes(List<Type> allTypes, NHibernate.Cfg.Configuration cfg, Func<string, string> formatter)
		{
			var m = new HbmMapping();
			m.Items = allTypes.Select(t =>
				{
					var sc = new HbmSubclass();
					sc.name = GetName(t);
					sc.extends = GetName(t.BaseType);
					sc.discriminatorvalue = map.GetOrCreateDefinition(t).Discriminator ?? t.Name;
					sc.lazy = false;
					sc.lazySpecified = true;

					var propertyMappings = GetPersistables(t)
						.Select(p => p.Attribute.GetPropertyMapping(p.DeclaringProperty, formatter))
						.ToList();
					if (propertyMappings.Count > 0)
					{
						if (sc.Items == null)
							sc.Items = propertyMappings.ToArray();
						else
							sc.Items = sc.Items.Union(propertyMappings).ToArray();
					}
					logger.DebugFormat("Generating subclass {0} with discriminator {1} extending {2} with {3} items ({4} property mappings)", sc.name, sc.discriminatorvalue, sc.extends, sc.Items != null ? sc.Items.Length.ToString() : "(null)", propertyMappings.Count);
					return sc;
				}).ToArray();
			if (Debugger.IsAttached)
			{
				var dbg = m.AsString();
			}
			cfg.AddDeserializedMapping(m, "N2");
		}
开发者ID:navneetccna,项目名称:n2cms,代码行数:31,代码来源:ClassMappingGenerator.cs

示例3: showOutputXmlMappings

 private void showOutputXmlMappings(HbmMapping mapping)
 {
     if (!ShowLogs) return;
     var outputXmlMappings = mapping.AsString();
     Console.WriteLine(outputXmlMappings);
     File.WriteAllText(OutputXmlMappingsFile, outputXmlMappings);
 }
开发者ID:yao-yi,项目名称:DNTProfiler,代码行数:7,代码来源:NHConfig.cs


注:本文中的NHibernate.Cfg.MappingSchema.HbmMapping.AsString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。