umbraco / UmbracoDocs

The official Umbraco Documentation
https://docs.umbraco.com
MIT License
266 stars 773 forks source link

Add documentation on related collections in repositories for Umbraco UI Builder #6500

Open jemayn opened 1 day ago

jemayn commented 1 day ago

What type of issue is it? (Choose one - delete the others)

Missing documentation

What article/section is this about?

https://docs.umbraco.com/umbraco-ui-builder/13.ui-builder.latest-lts/advanced/repositories https://docs.umbraco.com/umbraco-ui-builder/13.ui-builder.latest-lts/collections/related-collections

Describe the issue

In Umbraco UI Builder version 13.1.0 a new feature was added for related collections: https://docs.umbraco.com/umbraco-ui-builder/13.ui-builder.latest-lts/collections/related-collections

It explains pretty well how to use these related collections in the configurator, however if you use your own repository two new methods are added to the inherited class:

protected override TJunctionEntity SaveRelationImpl<TJunctionEntity>(TJunctionEntity entity)
{
    throw new NotImplementedException();
}

protected override IEnumerable<TJunctionEntity> GetRelationsByParentIdImpl<TJunctionEntity>(int parentId, string relationAlias)
{
    throw new NotImplementedException();
}

Those methods are not mentioned at all in the repository section: https://docs.umbraco.com/umbraco-ui-builder/13.ui-builder.latest-lts/advanced/repositories

I would love an example of how you should set those up, as it is not really clear to me šŸ™‚