本文整理汇总了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;
}
示例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;
}
示例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;
}