Yogesh Vedpathak

Yogesh Vedpathak

  • 674
  • 1.4k
  • 191.7k

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)