i have code like this :
var list = _appData.GetAdvanceSearchData(Convert.ToInt16(collection["Product"])).ToList();
List<ProductMaterial> materials = list.Select(x => x.ProductMaterial).Distinct().ToList();
Exception I got :
Cannot implicitly convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List<Crescent.LinqModel.ProductMaterial>'
whst should be done ?
Product Material Class :
public class ProductMaterial
{
public string ProductMaterials {get;set;}
}
list.Select(x => x.ProductMaterial).Distinct().ToList() gives me array string though have converted to list , i want the result of type 'ProductMaterial'.