Blog

Seleccione el resultado del siguiente código:

class Program {

static void Main(string[] args) {
var books = new List {
new Model { book = “EF in c#”, DateOfIssue = new DateTime(2020, 10, 12), AuthorName = “Delphine” },
new Model { book = “Advance c#”, DateOfIssue = new DateTime(2019, 01, 14), AuthorName = “Alap” },
new Model { book = “TS & JS”, DateOfIssue = new DateTime(2019, 12, 06), AuthorName = “Lucien” },
new Model { book = “Javascript”, DateOfIssue = new DateTime(2020, 08, 07), AuthorName = “Lucien” }
};

var nPs = books.Aggregate(new Model(), (a, b) => b.book.Contains(“c#”) ? a:b);
Console.WriteLine(nPs.AuthorName);
}

}