本文整理汇总了C#中IModelInspector.IsComponent方法的典型用法代码示例。如果您正苦于以下问题:C# IModelInspector.IsComponent方法的具体用法?C# IModelInspector.IsComponent怎么用?C# IModelInspector.IsComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IModelInspector
的用法示例。
在下文中一共展示了IModelInspector.IsComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatchOneToOneComponent
/// <summary>
/// Indicates if a given property matches a one to one component relationship
/// </summary>
/// <param name="property">The property</param>
/// <param name="modelInspector">An instance of the current model inspector</param>
/// <returns>True if the property matches a one to one component relationship, false if not</returns>
private bool MatchOneToOneComponent(PropertyPath property, IModelInspector modelInspector)
{
bool result = false;
if (modelInspector.IsComponent(property.LocalMember.DeclaringType))
{
result = (property.PreviousPath != null) && !property.PreviousPath.LocalMember.GetPropertyOrFieldType().IsGenericCollection();
}
return result;
}
示例2: TryMapComponent
private void TryMapComponent(IModelInspector modelInspector, PropertyPath member, IPropertyMapper propertyCustomizer)
{
if (modelInspector.IsComponent(member.LocalMember.DeclaringType)
&& !modelInspector.IsPersistentId(member.PreviousPath.LocalMember))
{
propertyCustomizer.Column(member.PreviousPath.LocalMember.Name + "_" + member.LocalMember.Name);
}
}