Question: I have lists of two Shapes - Rectangles and Circles.
They both share 3 common properties - ID , Type and Bounds

Circles have 2 extra properties - Range and Center 

How can i join lists of each type into a single list so i can iterate over them so i don't have to type two foreach cycles

Could this be donne in a better way than combining the lists ? 

```
public interface IRectangle
{
    string Id { get; set; }
    GeoLocationTypes Type { get; set; }
    Bounds Bounds { get; set; }
}

public class Rectangle : IRectangle
{
    public string Id { get; set; }

    public GeoLocationTypes Type { get; set; }

    public Bounds Bounds { get; set; }
}

public interface ICircle
{
    string Id { get; set; }
    GeoLocationTypes Type { get; set; }
    Bounds Bounds { get; set; }
    float Radius { get; set; }
    Coordinates Center { get; set; }
}

public class Circle : ICircle
{
    public string Id { get; set; }

    public GeoLocationTypes Type { get; set; }

    public Bounds Bounds { get; set; }

    public float Radius { get; set; }

    public Coordinates Center { get; set; }
}

public class Bounds
{
    public Coordinates NE { get; set; }

    public Coordinates SW { get; set; }
}

public class Coordinates
{
    public float Lat { get; set; }

    public float Lng { get; set; }
}

```

Answer: 
You could make them each use an IShape interface, or you could iterate over Objects and cast. 

```
public interface IShape
{
    string Id { get; set; }
    GeoLocationTypes Type { get; set; }
    Bounds Bounds { get; set; }
}

public interface IRectangle : IShape { }

public class Rectangle : IRectangle
{
    // No change
}

public interface ICircle : IShape
{
    float Radius { get; set; }
    Coordinates Center { get; set; }
}

public class Circle : ICircle
{
    // No change
}

public class Bounds
{
    // No change
}

public class Coordinates
{
    // No change
}

```

There is also the [Zip](http://msdn.microsoft.com/en-us/library/dd267698%28VS.100%29.aspx) function that will allow you to enumerate over all of them.

An example:

```
var numbers= new [] { 1, 2, 3, 4 };
var words = new [] { "one", "two", "three" };

var numbersAndWords = numbers.Zip(words, (n, w) => new { Number = n, Word = w });
foreach(var nw in numbersAndWords)
{
    Console.WriteLine(nw.Number + nw.Word);
}

```
How about this

```
var merged = Rectagles.Select(r => new { 
        r.Id, 
        r.Type, 
        r.Bounds,
        Radius = float.NaN,
        Centre = default(Coordinates) })
    .Concat(Circles.Select(c => new {
        c.Id, 
        c.Type, 
        c.Bounds,
        c.Radius,
        c.Centre }));

```

it gives a list of enumerable of an anonymous type that exposes the required information.

---

**EDIT**

To my amazement this actually seems to compile. So there is a solution that works without defining a common interface. However for anything but the quick and dirty I would consider polymorphic over anonymous.