Dynamic Column Name in LinQ
问题 I am having a class Item. class Item{ public int Id { get; set; } public DateTime CreatedDate { get; set; } public string Name { get; set; } public string Description { get; set;} } I want to filter list of items based on dynamic column name. Suppose I want list of Names then Column Name is "Name" and result will be list of names If column name is Description, I need list of descriptions. How to do this with LinQ? 回答1: Easy, just select the property you need from the list: var items = new