Yogesh Vedpathak

Yogesh Vedpathak

  • 1.1k
  • 1.1k
  • 71.4k

Unable to cast obj of model to system.collection.generic.IEnumerable

Sep 5 2020 8:53 AM
Hi , am getting below exception while casting 
can anyone guide me to fix this ...
 
Unable to cast object of type 'Corel.Common.Models.OneLineItem' to type 'System.Collections.Generic.IEnumerable`1[Corel.Common.Models.OneLineItem]'. 
 
 
created.ForEach(m => OneLineItems.AddRange((IEnumerable<OneLineItem>)m).Cast<OneLineItem>().ToList());
 

Answers (1)