本文整理汇总了C#中System.Reflection.PropertyInfo.IsSameAs方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyInfo.IsSameAs方法的具体用法?C# PropertyInfo.IsSameAs怎么用?C# PropertyInfo.IsSameAs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.PropertyInfo
的用法示例。
在下文中一共展示了PropertyInfo.IsSameAs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContainsSame
public static bool ContainsSame(this IEnumerable<PropertyInfo> enumerable, PropertyInfo propertyInfo)
{
//Contract.Requires(enumerable != null);
//Contract.Requires(propertyInfo != null);
foreach (var member in enumerable)
{
if (propertyInfo.IsSameAs(member))
{
return true;
}
}
return false;
}
示例2: Configure
internal override void Configure(
StorageAssociationSetMapping associationSetMapping, EdmModel database, PropertyInfo navigationProperty)
{
DebugCheck.NotNull(associationSetMapping);
DebugCheck.NotNull(database);
DebugCheck.NotNull(navigationProperty);
var table = associationSetMapping.Table;
if (_tableName != null)
{
table.SetTableName(_tableName);
table.SetConfiguration(this);
}
var sourceEndIsPrimaryConfiguration
= navigationProperty.IsSameAs(
associationSetMapping.SourceEndMapping.EndMember.GetClrPropertyInfo());
ConfigureColumnNames(
sourceEndIsPrimaryConfiguration ? _leftKeyColumnNames : _rightKeyColumnNames,
associationSetMapping.SourceEndMapping.PropertyMappings.ToList());
ConfigureColumnNames(
sourceEndIsPrimaryConfiguration ? _rightKeyColumnNames : _leftKeyColumnNames,
associationSetMapping.TargetEndMapping.PropertyMappings.ToList());
}
示例3: Configure
internal override void Configure(
AssociationSetMapping associationSetMapping, EdmModel database, PropertyInfo navigationProperty)
{
DebugCheck.NotNull(associationSetMapping);
DebugCheck.NotNull(database);
DebugCheck.NotNull(navigationProperty);
var table = associationSetMapping.Table;
if (_tableName != null)
{
table.SetTableName(_tableName);
table.SetConfiguration(this);
}
var sourceEndIsPrimaryConfiguration
= navigationProperty.IsSameAs(
associationSetMapping.SourceEndMapping.AssociationEnd.GetClrPropertyInfo());
ConfigureColumnNames(
sourceEndIsPrimaryConfiguration ? _leftKeyColumnNames : _rightKeyColumnNames,
associationSetMapping.SourceEndMapping.PropertyMappings.ToList());
ConfigureColumnNames(
sourceEndIsPrimaryConfiguration ? _rightKeyColumnNames : _leftKeyColumnNames,
associationSetMapping.TargetEndMapping.PropertyMappings.ToList());
foreach (var annotation in _annotations)
{
table.AddAnnotation(XmlConstants.CustomAnnotationPrefix + annotation.Key, annotation.Value);
}
}