|
|
|
@ -18,24 +18,24 @@ namespace Squidex.Infrastructure.Commands |
|
|
|
return !Equals(oldValue, newValue); |
|
|
|
} |
|
|
|
|
|
|
|
public static bool Change(string? oldValue, string newValue) |
|
|
|
public static bool Change(string oldValue, string newValue) |
|
|
|
{ |
|
|
|
return !Equals(oldValue, newValue); |
|
|
|
} |
|
|
|
|
|
|
|
public static bool ChangeWhenDefined(string? oldValue, string? newValue) |
|
|
|
public static bool OptionalChange(string oldValue, string? newValue) |
|
|
|
{ |
|
|
|
return !string.IsNullOrWhiteSpace(newValue) && !string.Equals(oldValue, newValue); |
|
|
|
} |
|
|
|
|
|
|
|
public static bool Change<T>(ISet<T>? oldValue, [NotNullWhen(true)] ISet<T>? newValue) |
|
|
|
public static bool OptionalChange<T>(ISet<T> oldValue, [NotNullWhen(true)] ISet<T>? newValue) |
|
|
|
{ |
|
|
|
return newValue != null && (oldValue == null || !newValue.SetEquals(oldValue)); |
|
|
|
return newValue != null && !newValue.SetEquals(oldValue); |
|
|
|
} |
|
|
|
|
|
|
|
public static bool Change<TKey, TValue>(IReadOnlyDictionary<TKey, TValue>? oldValue, [NotNullWhen(true)] IReadOnlyDictionary<TKey, TValue>? newValue) where TKey : notnull |
|
|
|
public static bool OptionalChange<TKey, TValue>(IReadOnlyDictionary<TKey, TValue> oldValue, [NotNullWhen(true)] IReadOnlyDictionary<TKey, TValue>? newValue) where TKey : notnull |
|
|
|
{ |
|
|
|
return newValue != null && (oldValue == null || !newValue.EqualsDictionary(oldValue)); |
|
|
|
return newValue != null && !newValue.EqualsDictionary(oldValue); |
|
|
|
} |
|
|
|
} |
|
|
|
} |