protected bool FindPropertyInHasMany(ActiveRecordModel model, string propertyName,
ref Type foundType, ref ActiveRecordModel foundModel)
{
foreach(HasManyModel hasManyModel in model.HasMany)
{
// Inverse=true relations will be ignored
if (hasManyModel.Property.Name == propertyName && !hasManyModel.HasManyAtt.Inverse)
{
foundType = hasManyModel.HasManyAtt.MapType;
foundModel = ActiveRecordModel.GetModel(foundType);
return true;
}
}
if (model.IsJoinedSubClass || model.IsDiscriminatorSubClass)
{
return FindPropertyInHasMany(model.Parent, propertyName, ref foundType, ref foundModel);
}
return false;
}