London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Try this:
ancestors.OfType<MyType>().FirstOrDefault()
It should work as long as your IContent can be casted to your MyType.
Hi guys,
I have a list of IContent Items, I know that one of the items will be of a particular type.
Currently I am getting this Item with this code:
I know the name of MyType how can do this without an hard coded Id?
If this number is diffrent in mulitiple enviorments the code will fail, can anyone show me how to do this?