You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've recently encountered a problem causing throwing an InvalidOperationException showed below.
System.InvalidOperationException: Failed to compare two elements in the array.
---> System.ArgumentException: At least one object must implement IComparable.
at System.Collections.Comparer.Compare(Object a, Object b)
at System.Collections.Generic.ObjectComparer`1.Compare(T x, T y)
at Microsoft.EntityFrameworkCore.Update.Internal.ModificationCommandComparer.Compare(ModificationCommand x, ModificationCommand y)
The problem occurs when EntityFramework's SaveChangesAsync() method is called after removing a few objects from the property of type List of some Entity. I've tried Remove(object), RemoveAt(index) and RemoveAll(lambdaExpression) methods. The solution was to implement IComparable interface to TypedIdValueBase class.
The text was updated successfully, but these errors were encountered:
Hi,
I've recently encountered a problem causing throwing an InvalidOperationException showed below.
The problem occurs when EntityFramework's SaveChangesAsync() method is called after removing a few objects from the property of type List of some Entity. I've tried Remove(object), RemoveAt(index) and RemoveAll(lambdaExpression) methods. The solution was to implement IComparable interface to TypedIdValueBase class.
The text was updated successfully, but these errors were encountered: