TigerMan
01/28/2025, 4:39 PMD_Inventor
01/28/2025, 5:12 PMContentAtRoot
from an UmbracoContext
. In controllers and views, you usually have access to Umbraco context, but you can also find it with IUmbracoContextAccessor
.D_Inventor
01/28/2025, 5:13 PMContentAtRoot
returns the root content in the order that you see them in the backoffice, but it may be appropriate to give your primary site some distinct property by which you can recognize it.TigerMan
01/28/2025, 5:20 PMD_Inventor
01/28/2025, 5:21 PMD_Inventor
01/28/2025, 5:22 PMvar umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
var contentAtRoot = umbracoContext.Content.GetContentAtRoot();
TigerMan
01/28/2025, 6:06 PMD_Inventor
01/28/2025, 6:08 PM