c# - How to find the number of items in a DynamicNodeList? -


is there property or function dynamicnodelist returns number of list items.

this code:

var root = model.nodebyid(id); var nodes = root.descendants("chartitem");  if (nodes.getlength() > 0) {    s = s + "<ul>"; } 

but getlength not valid function. should do?

there built in extension method ienumerable types called count(), that, counts items :)

see code below:

var root = model.nodebyid(id); var nodes = root.descendants("chartitem");  if (nodes.count() > 0) {     s = s + "<ul>"; } 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -