I am trying to cast IList
type to List
type but I am getting error every time.
List<SubProduct> subProducts= Model.subproduct;
Model.subproduct
returns IList<SubProduct>
.
Try
List<SubProduct> subProducts = new List<SubProduct>(Model.subproduct);
or
List<SubProduct> subProducts = Model.subproducts as List<SubProduct>;