Is there a way to use the DynamicNodeContext in a classic .NET class ? I would like to get the rid of Umbraco.Linq that seems to me a bit heavy with using DynamicNodes.
But I guess there are some issues with it. I created such a class. So I can access the Model. But I don't know if this is enough or I should do it another way. I have to override some Execute function fom the DynamicNodeContext, but no Idea what it has to do.
DynamicNodeContext
Is there a way to use the DynamicNodeContext in a classic .NET class ? I would like to get the rid of Umbraco.Linq that seems to me a bit heavy with using DynamicNodes.
But I guess there are some issues with it. I created such a class. So I can access the Model. But I don't know if this is enough or I should do it another way. I have to override some Execute function fom the DynamicNodeContext, but no Idea what it has to do.
{
public DynamicNode GetHomeSiteByRef(string reference)
{
return Model.XPath("\\HomePage[reference' = '" + reference + "'").FirstOrDefault();
}
public DynamicNode GetHomeSite(int nodeId)
{
DynamicNode node = new DynamicNode nodeId);
return node.AncestorOrSelf("HomePage");
}
}
is working on a reply...