Most of the websites I work on require bi-lingual capabilities, and as part of this we have some code which will copy any content created in the "root" language across to all other language sites that have been related to the root language. In version 6, I used the following code to check if a node had a relation:
var relationService = ApplicationContext.Current.Services.RelationService; if (relationService.GetByParentId(content.Id).Where(x => x.RelationType.Alias == "relateDocumentOnCopy").Count() == 0 && content.Level > 1) { // do something }
But this doesn't seem to work in v7 - has anything changed in the API that I need to be aware of? If I try the same code in v7 - I don't get the ".Where( .... )" option - only ".WhereNotNull<>". Any help would be greatly appreciated!
Check if node has a relation?
Good morning all,
Most of the websites I work on require bi-lingual capabilities, and as part of this we have some code which will copy any content created in the "root" language across to all other language sites that have been related to the root language. In version 6, I used the following code to check if a node had a relation:
But this doesn't seem to work in v7 - has anything changed in the API that I need to be aware of? If I try the same code in v7 - I don't get the ".Where( .... )" option - only ".WhereNotNull<>". Any help would be greatly appreciated!
Thanks
Schoolboy Error! I had accidentally removed the:
declaration from my class file! Duh!
is working on a reply...