CS1977: Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type.
Is there a problem because it is dynamic? how can i avoid this?
It's more than likely you are hitting a NULL at some point. Either an empty Folder, or Image. Simplify your code, and introduce any inner loops/foreachs's only when you are confident the outer one works :-)
Reverse Children of Media Folder
Hello. I am creating a Gallery in Umbraco 8.
I want to reverse the order of the images in my media-folder.
I have the following Code in Umbraco 8 in an Partial View. The Model of the Partial View is IPublishedContent.
Now i want to reverse the Images in "item.Children", how can i achieve this?
or i can sort it by NodeId Reverse, but i dont know how.
Please help me
Kind regards
...as simple as?
Thanks for your answer
I already tried this i got the error:
what am i doing wrong?
As an alternative to
.Reverse()
, you could use something like the following:Thanks for your answer.
Now i get this error:
Is there a problem because it is dynamic? how can i avoid this?
It's more than likely you are hitting a NULL at some point. Either an empty Folder, or Image. Simplify your code, and introduce any inner loops/foreachs's only when you are confident the outer one works :-)
Thanks for your answer.
I don't think im hitting a NULl but i tried it now, but there is another error now.
i get the Error:
hmmm, in umbraco 7 everything worked fine, i never should have changed in this new project^^ please help
Just do a....
Lets see if you have an actual array of anything! :-)
Now it shows
and if i do @item.Children in the inner foreach i get::
Did you try taking off the .Any() ??
yes the gallery is working, its everything ok, but i want to reverse the order of all images.
the normal order is working normally. But i don't know how to reverse the item.Children in the inner foreach.
Its now working, i did it the following. Thanks you raised me on the right way.
This line did the Trick:
You'll probably want to use this...
As ID, is merely the ID of the media item, and not it's sort position in the Media Tree..
is working on a reply...