I have a scenario where members will be linked to (multiple) Doctype venues.
I'm just trying to decide the best way to query the relationship between the two and am looking at the relation API.
I've setup a Parent > Child relationship between the Member and Doctype, now I would like to load all associated Doctypes for a user when they login.
I've got as far as this but now I'm stuck, should I use GetByParent/GetByRelationTypeAlias?
var memberService = Services.MemberService;
var relationService = Services.RelationService;
var member = memberService.GetById(Members.GetCurrentMemberid())
relationService.GetByParent???
Either option looks like it returns an IEnumerable
*EDIT*
Or should I be looking at different ways to relate members with content? I've now seen that there's no inbuilt way to manage relationships without a 3rd party package. I originally had a member picker property on the documents that allowed admin users to simply assign members, I could also populate this easily via ContentService on creating a new document, however I thought it may get sluggish having to loop through every document checking for that property when the user logged in and the relation functionality looked as though it would be more efficient.
Any input or suggestions would be helpful. thanks!
Relations GetByParent?
I have a scenario where members will be linked to (multiple) Doctype venues.
I'm just trying to decide the best way to query the relationship between the two and am looking at the relation API.
I've setup a Parent > Child relationship between the Member and Doctype, now I would like to load all associated Doctypes for a user when they login.
I've got as far as this but now I'm stuck, should I use GetByParent/GetByRelationTypeAlias?
Either option looks like it returns an IEnumerable
*EDIT* Or should I be looking at different ways to relate members with content? I've now seen that there's no inbuilt way to manage relationships without a 3rd party package. I originally had a member picker property on the documents that allowed admin users to simply assign members, I could also populate this easily via ContentService on creating a new document, however I thought it may get sluggish having to loop through every document checking for that property when the user logged in and the relation functionality looked as though it would be more efficient.
Any input or suggestions would be helpful. thanks!
I did what I always do and I went charging in before trying something out.
Found you can GetByRelationTypeAlias() which returns a list of objects with associated Parent/Child Node Id's
is working on a reply...