How can I create a new Relation Type with Umbraco Relation Service?
At application started I want to define all my Relation Types (which I'm going to use in my application later). Is it possible?
var relationType = new RelationType(new Guid("A7CE7344-9A2E-4567-8BC9-8901BB9B9F5B"),new Guid("F65E0D53-E0A9-46D9-94D7-EA5009E48D55"), "relationTypeAlias", "Relation Type Name"){IsBidirectional = true};
ApplicationContext.Services.RelationService.Save(relationType);
Create a new RelationType
How can I create a new Relation Type with Umbraco Relation Service? At application started I want to define all my Relation Types (which I'm going to use in my application later). Is it possible?
-thanks
Hi,
It is possible - for example:
Check out how Umbraco does it here:
https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/NewRelationType.aspx.cs#L53
is working on a reply...