Collection reference entity

Posted by Community Admin on 03-Aug-2018 12:50

Collection reference entity

All Replies

Posted by Community Admin on 16-Mar-2011 00:00

Hey,

I need to extend my own main entity in Sitefinity with a collection of sub-entities (like add comments for post). So basically there should be a reference field to main entity (post_id or smth) and from the main entity I should be able to get all comments. How do I update database with sitefinity FluentAPI for that?

Posted by Community Admin on 16-Mar-2011 00:00

Hi Vitaly,

You can use custom fields which you can add from the UI or programmatically. Each content object has a data expression methods - GetValue, SetValue that you can use.

All the best,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 16-Mar-2011 00:00

Is it intended for this purpose? I was curious what will happen in case of many comments. Also - how do I add it from UI?

Posted by Community Admin on 18-Mar-2011 00:00

Hi Vitaly,

The custom fields are related to the content object which has relation to the comments. I attached a screenshot which shows how you can add a filed from the UI. You can use the fluent api and DataExtenssion method of the content object GetValue("") to get the data entered by your custom field.

Best wishes,
Ivan Dimitrov
the Telerik team

This thread is closed