可以使用 PortalID NULL 创建 ProfilePropertyDefinition 吗?

It is possible to create a ProfilePropertyDefinition with PortalID NULL?

我一直在使用此代码创建 ProfilePropertyDefinition:

ProfileController.AddPropertyDefinition(new ProfilePropertyDefinition(objUserInfo.PortalID) { PropertyName = propName, PropertyCategory = propCategory, DataType = 2, ReadOnly = false });

objUserInfo.PortalID 是一个整数,所以我不能在这里传递 null。

还有另一种创建 PortalID NULL 的 PropertyDefinition 的方法吗?

这在 API 中不受支持,因为实际的个人资料信息是在每个门户的基础上关联的。

DB 体系结构允许这样做,但您将绕过 DNN API 以实际插入值。此外,DNN API 不会提取用户的配置文件信息,因为它始终使用门户 ID 值。