Try our conversational search powered by Generative AI!

Obtain a ContentReference from a string



How is it possible to obtain a ContentReference object from an Id in a string?

I need to run the following command:

private IContentRepository _repLoad;
_repLoad = repo; // repo is injected from constructor

IEnumerable children = _repLoad.GetChildren("content link in a string");


Nov 22, 2018 20:22

Use ContentReference.Parse("123");

Nov 22, 2018 23:54

I would vote for `ContentReference.TryParse()` as this method is not throwing exception in case of junk. I've read on internets that exceptions are bad for your health.

Nov 23, 2018 8:06
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.