mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
CommandComparer supports IEnumerables now
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -46,7 +48,18 @@ namespace NzbDrone.Core.Messaging.Commands
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!xValue.Equals(yValue))
|
||||
if (typeof(IEnumerable).IsAssignableFrom(xProperty.PropertyType))
|
||||
{
|
||||
var xValueCollection = ((IEnumerable)xValue).Cast<object>().OrderBy(t => t);
|
||||
var yValueCollection = ((IEnumerable)yValue).Cast<object>().OrderBy(t => t);
|
||||
|
||||
if (!xValueCollection.SequenceEqual(yValueCollection))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!xValue.Equals(yValue))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user