public class EmployeerRequest
{
public long EmployeeRequestID { get; set; }
public long EmployeePolicyID { get; set; }
public string EmployeeSrNo { get; set; }
public string EmployeeSequenceNo { get; set; }
}
List<EmployeerRequest> empRequestList = new List<EmployeerRequest>();
var r = empRequestList.Select(x => new
{
EmployeeRequestID = x.EmployeeRequestID,
EmployeePolicyID = x.EmployeePolicyID
});
var r = empRequestList.Select(x => new
{
EmployeePolicyID = x.EmployeePolicyID,
EmployeeSrNo = x.EmployeeSrNo
});
var r = empRequestList.Select(x => new
{
EmployeeSequenceNo = x.EmployeeSequenceNo
});
我想在linq中选择动态列,如上所述,具体取决于参数中传递的列参数。如何给动态选择?