Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
In v6.1.x are we still using the old Relation.GetRelations(nodeId) API call or is there a new way of doing this?
Thanks, Simon
I see there is a new RelationsService but no documentation yet, is this the corect way of doing things?
RelationType relationType = rs.GetRelationTypeByAlias("relateDocumentOnCopy"); IEnumerable<Relation> relations = rs.GetAllRelationsByRelationType(relationType).Where(r => r.ParentId == node.Id);
I've made a start on documenting the service and will submit a pull request when done however in doing so I've discovered a more suitable method of achieving of what I am after and re-factored it as follows:
RelationService rs = ApplicationContext.Current.Services.RelationService; IEnumerable<Relation> relations = rs.GetByParentId(node.Id).Where(r => r.RelationType.Alias == "relateDocumentOnCopy");
I've had a go at documenting the service now and sent a pull request so hopefully it is accepted and can be of use to others:
https://github.com/umbraco/Umbraco4Docs/pull/120
Hi there
I have seen your documentation, thanks for this. I am having quite some trouble getting my relations working in the new code. Any help would be much appreciated: http://our.umbraco.org/forum/developers/razor/48594-Language-Dropdown-Help-Required-Umbraco-703
Kind regardsJonathan
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to get content relations in v6.1.x
In v6.1.x are we still using the old Relation.GetRelations(nodeId) API call or is there a new way of doing this?
Thanks, Simon
I see there is a new RelationsService but no documentation yet, is this the corect way of doing things?
Thanks, Simon
I've made a start on documenting the service and will submit a pull request when done however in doing so I've discovered a more suitable method of achieving of what I am after and re-factored it as follows:
I've had a go at documenting the service now and sent a pull request so hopefully it is accepted and can be of use to others:
https://github.com/umbraco/Umbraco4Docs/pull/120
Hi there
I have seen your documentation, thanks for this. I am having quite some trouble getting my relations working in the new code. Any help would be much appreciated: http://our.umbraco.org/forum/developers/razor/48594-Language-Dropdown-Help-Required-Umbraco-703
Kind regards
Jonathan
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.