本文整理汇总了C#中IModelInspector.IsOneToMany方法的典型用法代码示例。如果您正苦于以下问题:C# IModelInspector.IsOneToMany方法的具体用法?C# IModelInspector.IsOneToMany怎么用?C# IModelInspector.IsOneToMany使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IModelInspector
的用法示例。
在下文中一共展示了IModelInspector.IsOneToMany方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DetermineKeyColumnName
private static string DetermineKeyColumnName(IModelInspector inspector, PropertyPath member)
{
var otherSideProperty = member.OneToManyOtherSideProperty();
if (inspector.IsOneToMany(member.LocalMember) && otherSideProperty != null)
return otherSideProperty.Name + ForeignKeyColumnPostfix;
return member.Owner().Name + ForeignKeyColumnPostfix;
}
示例2: GetKeyColumnName
protected virtual string GetKeyColumnName(IModelInspector modelInspector, PropertyPath member)
{
MemberInfo otherSideProperty = member.OneToManyOtherSideProperty();
Type type = modelInspector.IsOneToMany(member.LocalMember) && otherSideProperty != null
? otherSideProperty.MemberType()
: member.MemberType();
return GetKeyColumnName(modelInspector, type, true);
}
示例3: GetKeyColumnName
/// <summary>
/// Gets the foreign key field name to use for a property.
/// </summary>
private string GetKeyColumnName(IModelInspector inspector, PropertyPath member)
{
var otherSideProperty = member.OneToManyOtherSideProperty();
if (inspector.IsOneToMany(member.LocalMember) && otherSideProperty != null)
{
return otherSideProperty.Name + _foreignKeyColumnSuffix;
}
return member.GetRootMemberType().Name + _foreignKeyColumnSuffix;
}