Я не знаю, почему моя программа не работает.Не могли бы вы мне помочь, пожалуйста !У меня есть внутреннее исключение, когда я запускаю его.
var peoples = new List<People>();
peoples.Add(new People { Model = "Mustang", FirstName = "Joe", LastName = "L'indien" });
peoples.Add(new People { Model = "Corvet", FirstName = "Luc", LastName = "Emince" });
peoples.Add(new People { Model = "Verron", FirstName = "pierre", LastName = "Uneed" });
peoples.Add(new People { Model = "Viper", FirstName = "Martial", LastName = "Roste" });
peoples.Add(new People { Model = "Camaro", FirstName = "Franck", LastName = "Vador" });
var cars = this._cars = new List<Car>();
cars.Add(new Car { Model = "Mustang", Description = "Gros paté" });
cars.Add(new Car { Model = "Mustang", Description = "Paté" });
cars.Add(new Car { Model = "Verron", Description = "Très gros paté" });
cars.Add(new Car { Model = "Viper", Description = "Attention paté" });
cars.Add(new Car { Model = "Viper", Description = "Attention paté" });
var PeopleCar = from people in peoples
join car in cars on people.Model equals car.Model into outer
from car in outer.DefaultIfEmpty()
select new
{
people.FirstName,
people.LastName,
car.Model,
Desc = (people == null) ? "CASSE DE MERDE" : car.Description
};
foreach (var item in PeopleCar)
{
textBox1.AppendText(String.Format("Mr {0} {1} a une voiture model {2} qui envoie du {3}"
+ Environment.NewLine, item.FirstName, item.LastName, item.Model, item.Desc));
}