My object is in this form
List<SignUp>
class SignUp
{
public int Id { get ; set;}
public int VersionId { get ; set;}
public int PersonId{ get ; set;}
public DateTime? SignUpDate { get ; set;}
}
People signup to a version of a document. Some versions never get archived and they have to resign every year. so I end up with records like
SignUp s = new SignUp { Id = 1, VersionId = 1, PersonId = 5}
SignUp s2 = new SignUp { Id = 2, VersionId = 2, PersonId = 5}
SignUp s3 = new SignUp { Id = 3, VersionId = 1, PersonId = 5}
No this list which has s, s2, s3 has 2 duplicates on personId, versionId combination which are s & s3. only thing is s3 has a higher Id than s. Hence I want to eliminate s and just display s2, s3 (s is an older version and I ignore it)
How can this be achieved using a linq query if possible?