In reference to this question of mine, C# Custom list duplicate values based on a property
I have two custom lists, let say,
Public class HouseColony
{
public string Name { get; set; }
public string Location { get; set; }
public string NumberOfHouses { get; set; }
}
Public class House
{
public string Name { get; set; }
public string Location { get; set; }
public string AreaCovered { get; set; }
}
Now I am getting all HouseColony
from a external web service, then while getting each HouseColony
I am trying to get all House in this specific colony.
What I am trying to do
I don't want houses that have same number of AreaCovered
in any of HouseColony.
For example: if House Colony A has a houses with Area Covered = 1009 then another house colony has any house with Area Covered = 1009 then ignore it Add house with area just once, at the moment I am doing this,
Foreach(HouseColny...)
{
List<Houses> houses = new ...
List<Houses> houses = GetAllHouses(HouseColonyName);
}
I made up this scenario and naming convetion
Edit
Can I do something that relate houses with House Colony list and then compare then at end ?