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


C# IValue.CreateForeignKey方法代码示例

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


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

示例1: CreateProperty

        protected Mapping.Property CreateProperty(IValue value, string propertyName, System.Type parentClass,
			XmlNode subnode)
        {
            if (parentClass != null && value.IsSimpleValue)
                value.SetTypeUsingReflection(parentClass.AssemblyQualifiedName, propertyName, PropertyAccess(subnode));

            // This is done here 'cos we might only know the type here (ugly!)
            if (value is ToOne)
            {
                ToOne toOne = (ToOne) value;
                string propertyRef = toOne.ReferencedPropertyName;
                if (propertyRef != null)
                    mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
            }

            value.CreateForeignKey();
            Mapping.Property prop = new Mapping.Property();
            prop.Value = value;
            BindProperty(subnode, prop);

            return prop;
        }
开发者ID:aistrate,项目名称:TypingPracticeTexts,代码行数:22,代码来源:ClassBinder.cs

示例2: CreateProperty

		private static Mapping.Property CreateProperty( IValue value, string propertyName, System.Type parentClass, XmlNode subnode, Mappings mappings )
		{
			if( parentClass != null && value.IsSimpleValue )
			{
				( ( SimpleValue ) value ).SetTypeByReflection( parentClass, propertyName, PropertyAccess( subnode, mappings ) );
			}

			// This is done here 'cos we might only know the type here (ugly!)
			if( value is ToOne )
			{
				string propertyRef = ( ( ToOne ) value ).ReferencedPropertyName;
				if( propertyRef != null )
				{
					mappings.AddUniquePropertyReference( ( ( EntityType ) value.Type ).AssociatedClass, propertyRef );
				}
			}

			value.CreateForeignKey();
			Mapping.Property prop = new Mapping.Property();
			prop.Value = value;
			BindProperty( subnode, prop, mappings );

			return prop;
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:24,代码来源:Binder.cs

示例3: CreateProperty

		protected Property CreateProperty(IValue value, string propertyName, string className,
			XmlNode subnode, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			if (string.IsNullOrEmpty(propertyName))
			{
				throw new MappingException(subnode.LocalName + " mapping must defined a name attribute [" + className + "]");
			}

			if (!string.IsNullOrEmpty(className) && value.IsSimpleValue)
				value.SetTypeUsingReflection(className, propertyName, PropertyAccess(subnode));

			// This is done here 'cos we might only know the type here (ugly!)
			var toOne = value as ToOne;
			if (toOne != null)
			{
				string propertyRef = toOne.ReferencedPropertyName;
				if (propertyRef != null)
					mappings.AddUniquePropertyReference(toOne.ReferencedEntityName, propertyRef);
			}

			value.CreateForeignKey();
			var prop = new Property {Value = value};
			BindProperty(subnode, prop, inheritedMetas);

			return prop;
		}
开发者ID:nkmajeti,项目名称:nhibernate,代码行数:26,代码来源:ClassBinder.cs


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