using System.Collections.Generic;
public static void Main()
var product1 = new Product() { Name = "C# Eval Expression", Url = "https://eval-expression.net/", Type = "Paid" };
var product2 = new Product() { Name = "Dapper Plus", Url = "https://dapper-plus.net/", Type = "Paid" };
var product3 = new Product() { Name = "Entity Framework Extensions", Url = "https://entityframework-extensions.net/", Type = "Paid" };
var list = new List<Product>() { product1, product2, product3 };
var max = list.MaxDynamic<Product, string>("x => x.Name");
Console.Write("Max product name: {0}", max);
public string Name { get; set; }
public string Url { get; set; }
public string Type { get; set; }