Craig100
09/23/2023, 12:38 AMList<EventItem> eventList = new List<EventItem>();
// Get all Single Event Items
List<SingleEventItem> singleEventList = CurrentPage.Children<SingleEventItem>().ToList();
eventList = _umbracoMapper.Map(singleEventList, eventList);
The error is:-
``InvalidOperationException: Don't know how to map System.Collections.Generic.List`1[[Umbraco.Cms.Web.Common.PublishedModels.SingleEventItem, Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] to System.Collections.Generic.List`1[[Umbraco.Cms.Web.Common.PublishedModels.EventItem, Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].``
It's my first time mapping stuff and I've probably got it horribly wrong, so any advice would be appreciated.
Thanks.ryanhelmn
09/23/2023, 7:40 AMCraig100
09/23/2023, 11:16 AMList<EventItem> eventList = new List<EventItem>();
List<SingleEventItem> singleEventList = CurrentPage.Children<SingleEventItem>().ToList();
Craig100
09/23/2023, 3:37 PMMatt Wise
09/24/2023, 6:23 AMCraig100
09/26/2023, 8:50 PMeventList = _umbracoMapper.MapEnumerable(singleEventList, eventList);
?Matt Wise
09/27/2023, 5:40 AMAmbert
09/27/2023, 7:31 AMCraig100
09/27/2023, 12:26 PMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by