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; }
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)); }
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); }
/// <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 + this._foreignKeyColumnSuffix); } return(member.GetRootMemberType().Name + this._foreignKeyColumnSuffix); }
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); }
/// <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; }