kaushik.debnath
New member
- Joined
- Jul 21, 2021
- Messages
- 1
- Programming Experience
- 10+
I want to remove the duplicates from the List, for that I am using following code:
But its not working and did not giving unique records. Its not able to remove the duplicates.
Please suggest in this.
C#:
public List<ContainerLevelDetailsResponse> ContainerLevelDetails { get; set; }
public class ContainerLevelDetailsResponse
{
public long ContainerId { get; set; }
public string Container { get; set; }
public string Pallet { get; set; }
public string SKU { get; set; }
public long CaseCount { get; set; }
}
List<ContainerLevelDetailsResponse> containerLevelDetails =
new List<ContainerLevelDetailsResponse>();
booking.ContainerLevelDetails = containerLevelDetails.Distinct().ToList<ContainerLevelDetailsResponse>();
Please suggest in this.
Last edited by a moderator: