var empIds = empList.Select(x => x.EmployeeId).ToList();
var anyDuplicate = empIds.GroupBy(x => x).Any(grp => grp.Count() > 1);
It return bool value (anyDuplicate==true) if any record will be duplicate.
var anyDuplicate = empIds.GroupBy(x => x).Any(grp => grp.Count() > 1);
It return bool value (anyDuplicate==true) if any record will be duplicate.
No comments:
Post a Comment