本文整理汇总了C#中System.Reflection.PropertyInfo.IsValidEdmNavigationProperty方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyInfo.IsValidEdmNavigationProperty方法的具体用法?C# PropertyInfo.IsValidEdmNavigationProperty怎么用?C# PropertyInfo.IsValidEdmNavigationProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.PropertyInfo
的用法示例。
在下文中一共展示了PropertyInfo.IsValidEdmNavigationProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NavigationPropertyConfiguration
internal NavigationPropertyConfiguration(PropertyInfo navigationProperty)
{
DebugCheck.NotNull(navigationProperty);
Debug.Assert(navigationProperty.IsValidEdmNavigationProperty());
_navigationProperty = navigationProperty;
}
示例2: ApplyPropertyConfiguration
// Not using the public API to avoid configuring the property as a navigation property if it wasn't one before
internal override void ApplyPropertyConfiguration(
PropertyInfo propertyInfo, Func<PropertyConfiguration> propertyConfiguration, ModelConfiguration modelConfiguration)
{
DebugCheck.NotNull(propertyInfo);
DebugCheck.NotNull(propertyConfiguration);
DebugCheck.NotNull(modelConfiguration);
if (propertyInfo.IsValidEdmNavigationProperty()
&& !propertyInfo.PropertyType.IsCollection()
&& _attributeProvider.GetAttributes(propertyInfo).OfType<RequiredAttribute>().Any())
{
var navigationPropertyConfiguration = (NavigationPropertyConfiguration)propertyConfiguration();
if (navigationPropertyConfiguration.RelationshipMultiplicity == null)
{
navigationPropertyConfiguration.RelationshipMultiplicity = (RelationshipMultiplicity.One);
}
}
}