1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-25 01:11:43 +00:00

fixed broken tests.

This commit is contained in:
kay.one 2013-02-15 20:16:33 -08:00
parent eb90040dd6
commit 1adc2892db

View file

@ -35,25 +35,20 @@ public void EnsureIds<T>(T obj, HashSet<object> context)
modelBase.Id = _indexProvider.Next(obj.GetType()); modelBase.Id = _indexProvider.Next(obj.GetType());
} }
foreach (var propertyInfo in GetPotentialProperties(obj.GetType())) var list = obj as IEnumerable;
{
var propValue = propertyInfo.GetValue(obj, null);
var list = propValue as IEnumerable;
if (list != null) if (list != null)
{ {
foreach (var item in list) foreach (var item in list)
{ {
EnsureIds(item, context); EnsureIds(item, context);
} }
return;
} }
else
foreach (var propertyInfo in GetPotentialProperties(obj.GetType()))
{ {
var propValue = propertyInfo.GetValue(obj, null);
EnsureIds(propValue, context); EnsureIds(propValue, context);
}
} }
} }