Ported from : https://aspnet.codeplex.com/workitem/10340
The fix is to change the following code in SampleGeneration/ObjectGenerator.cs
Replace
```
Type type = collectionType.IsGenericType ?
collectionType.GetGenericArguments()[0] :
typeof(object);
```
with
```
Type type;
if (collectionType.IsGenericType)
{
type = collectionType.GetGenericArguments()[0];
}
else
{
if (collectionType.BaseType != null && collectionType.BaseType.IsGenericType)
{
type = collectionType.BaseType.GetGenericArguments()[0];
}
else
{
type = typeof (object);
}
}
```
This fixes the sample xml/json generation for classes like
```
[CollectionDataContract(Name = "Addresses", Namespace = "")]
public class Addresses : List<Address>
{
}
```
The fix is to change the following code in SampleGeneration/ObjectGenerator.cs
Replace
```
Type type = collectionType.IsGenericType ?
collectionType.GetGenericArguments()[0] :
typeof(object);
```
with
```
Type type;
if (collectionType.IsGenericType)
{
type = collectionType.GetGenericArguments()[0];
}
else
{
if (collectionType.BaseType != null && collectionType.BaseType.IsGenericType)
{
type = collectionType.BaseType.GetGenericArguments()[0];
}
else
{
type = typeof (object);
}
}
```
This fixes the sample xml/json generation for classes like
```
[CollectionDataContract(Name = "Addresses", Namespace = "")]
public class Addresses : List<Address>
{
}
```