|
|
@ -35,25 +35,20 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
modelBase.Id = _indexProvider.Next(obj.GetType());
|
|
|
|
modelBase.Id = _indexProvider.Next(obj.GetType());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var propertyInfo in GetPotentialProperties(obj.GetType()))
|
|
|
|
var list = obj as IEnumerable;
|
|
|
|
|
|
|
|
if (list != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var propValue = propertyInfo.GetValue(obj, null);
|
|
|
|
foreach (var item in list)
|
|
|
|
|
|
|
|
|
|
|
|
var list = propValue as IEnumerable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (list != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EnsureIds(item, context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EnsureIds(propValue, context);
|
|
|
|
EnsureIds(item, context);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var propertyInfo in GetPotentialProperties(obj.GetType()))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var propValue = propertyInfo.GetValue(obj, null);
|
|
|
|
|
|
|
|
EnsureIds(propValue, context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|