linq.js - get all values from dictionary -
i'm using linqjs in website , i'm trying values of dictionary populated todictionary()
library extension.
here code:
var imagesdictionary = enumerable.from(data) .select(function (x) { var images = enumerable.from(x.imagessections) .selectmany(function (y) { return enumerable.from(y.images) .select(function (z) { return z.thumb; }); }) .toarray(); return { title: x.title, images: images }; }) .todictionary("$.title", "$.images"); var imagestopreload = imagesdictionary.toenumerable() .selectmany("$.value");
i imagestopreload become array of images contained in dictionary can't understand how , this:
var imagestopreload = imagesdictionary.toenumerable() .selectmany("$.value");
seems way used obtain that.
could me?
since appears you're using linqjs 3 beta version, format of entries have changed. properties in lowercase now.
var imagesdictionary = enumerable.from(data) .todictionary("$.title", "enumerable.from($.imagessections).selectmany('$.images', '$$.thumb').toarray()" ); var imagestopreload = imagesdictionary.toenumerable() .selectmany("$.value") // lowercase 'value' .toarray();
Comments
Post a Comment