how to fill response with seperated nested list
error is : " cannot implicity convert type system collection generic list
public List<ScoreViewResponse> GetMasterScoring(ScoreViewRequest request)
{
var data = employeeQueryRepository.GetMasterScoring(request).Tables[0].DataTableToListObject<ScoreViewResponse>().Take(1).ToList();
var list = employeeQueryRepository.GetMasterScoring(request).Tables[0].DataTableToListObject<ScoreViewResponse>().ToList();
foreach (var item in list)
{
ListData listData = item.ListValue;
var lst = new ListData();
lst.IdItem = item.IdItem;
lst.TextValue = item.TextValue;
data.ListValue = listData; --> error cannot map to property iditem and text valiu list
};
return data;
}
public class ScoreViewResponse
{
[JsonIgnore]
public int RowNumber { get; set; }
[JsonIgnore]
public int IdItem { get; set; }
public string Description { get; set; }
public string Product { get; set; }
[JsonIgnore]
public string TextValue { get; set; }
public int IDScore { get; set; }
public List<ListData> ListValue { get; set; }
}
public class ListData
{
public int IdItem { get; set; }
public string TextValue { get; set; }
}