mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
389 B
13 lines
389 B
using Microsoft.EntityFrameworkCore.ChangeTracking; |
|
|
|
namespace ErsatzTV.Infrastructure.Data.Configurations; |
|
|
|
public class CollectionValueComparer<T> : ValueComparer<ICollection<T>> |
|
{ |
|
public CollectionValueComparer() : base( |
|
(c1, c2) => c1.SequenceEqual(c2), |
|
c => c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())), |
|
c => c.ToHashSet()) |
|
{ |
|
} |
|
}
|
|
|