Hi, I am migrating an Umbraco 7 site onto Umbraco 8, and would like to know the best way to get strongly typed Content in Umbraco 8. I have read that XPath shouldn't be used, and LINQ should be used instead, but what code can I use for this? I have the Node name with me in order to find the node. Could you please help?
It's all change in V8! - whereas in V7 the published cache was stored in XML format and therefore nothing could beat XPath for speed, now there is this new memory-based 'nucache' implementation which is optimized for Linq queries...
(XPATH has been retained, for some of the concepts in Umbraco like 'setting the start node in a multinode tree picker' - but it is no longer suggested to use XPATH for querying on your site implementation - you can - but it's no longer the 'quickest' method,)
Paul Seal and Tim Payne gave a talk at Umbraco Spark - before lockdown regarding their investigations into performance and querying in V8 and their slides are available here;
The slides have some useful examples, and show the timings of accessing content in different ways between V7 and V8.. showing some of the places where certain strategies are faster than others.
Get Strongly Typed Content Umbraco 8
Hi, I am migrating an Umbraco 7 site onto Umbraco 8, and would like to know the best way to get strongly typed Content in Umbraco 8. I have read that XPath shouldn't be used, and LINQ should be used instead, but what code can I use for this? I have the Node name with me in order to find the node. Could you please help?
Hi Yasharth
It's all change in V8! - whereas in V7 the published cache was stored in XML format and therefore nothing could beat XPath for speed, now there is this new memory-based 'nucache' implementation which is optimized for Linq queries...
(XPATH has been retained, for some of the concepts in Umbraco like 'setting the start node in a multinode tree picker' - but it is no longer suggested to use XPATH for querying on your site implementation - you can - but it's no longer the 'quickest' method,)
Paul Seal and Tim Payne gave a talk at Umbraco Spark - before lockdown regarding their investigations into performance and querying in V8 and their slides are available here;
https://umbracospark.com/media/p0xgaq2u/querying-umbraco.pptx
The slides have some useful examples, and show the timings of accessing content in different ways between V7 and V8.. showing some of the places where certain strategies are faster than others.
regards
Marc
is working on a reply...