mirror of
https://github.com/Radarr/Radarr
synced 2024-12-24 08:52:38 +00:00
fixed broken tests.
This commit is contained in:
parent
eb90040dd6
commit
1adc2892db
1 changed files with 11 additions and 16 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var list = obj as IEnumerable;
|
||||||
|
if (list != null)
|
||||||
|
{
|
||||||
|
foreach (var item in list)
|
||||||
|
{
|
||||||
|
EnsureIds(item, context);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var propertyInfo in GetPotentialProperties(obj.GetType()))
|
foreach (var propertyInfo in GetPotentialProperties(obj.GetType()))
|
||||||
{
|
{
|
||||||
var propValue = propertyInfo.GetValue(obj, null);
|
var propValue = propertyInfo.GetValue(obj, null);
|
||||||
|
EnsureIds(propValue, context);
|
||||||
var list = propValue as IEnumerable;
|
|
||||||
|
|
||||||
if (list != null)
|
|
||||||
{
|
|
||||||
foreach (var item in list)
|
|
||||||
{
|
|
||||||
EnsureIds(item, context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EnsureIds(propValue, context);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue