DynamicNodeList doesn't expose Count but rather assumes on the GetEnumerator that it's Items won't be null even though they have a publically accessible setter..
just wondering for now is the applicable check something like:
No, you only need the macroengines dll. Be aware that this is a nightly build and not a final so things could break. If they do, don't worry, it is going to be an easy fix! :-)
Would like to know if the upgrade goes well so there's some more user feedback for the upcoming 4.7.1 release.
Ah I see, that's not at all related to the original question, but an interesting one. Could you post it as a new question please? That will make it easier for other people to find later.
Proper Check For DynamicNodeList?
Hi Guys,
DynamicNodeList doesn't expose Count but rather assumes on the GetEnumerator that it's Items won't be null even though they have a publically accessible setter..
just wondering for now is the applicable check something like:
var something = @Model.Children;
if(something.Items != null && something.Items.Count > 0) { //do stuff; }
In 4.7.1 you will be able to just do Model.Children.Count() - Get a copy of umbraco.macroengines.dll from the latest nightly build.
Hi Sebastian,
Is there any other dependancy if I am using this umbraco.macroengines.dll from this build.
Thanks,
Rajeev
No, you only need the macroengines dll. Be aware that this is a nightly build and not a final so things could break. If they do, don't worry, it is going to be an easy fix! :-)
Would like to know if the upgrade goes well so there's some more user feedback for the upcoming 4.7.1 release.
Thank you for the update.
I have a Node with Property startDate and endDate and have its template
I need to display the item in the template only if that is within the date range.
Otherwise that shouldn't be shown in the page.
@Model will give the dynamic node, I would like to know how to check the date range for this, I have tried the .Where and
@Model.startDate >=DateTime.Now.Date etc and I am getting an error like DynamicNull cannot use >= with DateTime.Date
Thanks,
Rajeev
Ehm, I don't know what your question is? Or answer?
Edited the question above after trying with that.
Please let me know if you understand my question.
Thanking you.
Ah I see, that's not at all related to the original question, but an interesting one. Could you post it as a new question please? That will make it easier for other people to find later.
I'll dig up some code I have for this scenario.
I have posted that as a new topic. Thank you.
is working on a reply...