In a list similar to this: `
public static List<Items> Models()
{
List<Items> listOfModels = new List<Items>()
{
new Items() {
ModelID="M10",
ModelNames = new List<string>() {"model1","model2"}},
new Items() {
ModelID="M20",
ModelName = new List<string>(){"model3","model4","model5"}}
};
return listOfModels;
}
`
How to get the following output? (model1,m10) (model2,m10) (model3,m20) (model4,m20) (model5,m20)
var allModels = Models().SelectMany(c => c.ModelName)
output : model , model2, model3,...