我在从通用列表中获取记录时遇到问题。我创建了一个通用函数,我想从中获取任何类型的类的记录。以下是示例代码:-
public void Test<T>(List<T> rEntity) where T : class { object id = 1; var result = rEntity.Where(x => x.id == id); }
请建议。提前致谢。
c# linq generic-list
c# ×1
generic-list ×1
linq ×1