diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2026-08-01 14:25:20 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2026-08-01 14:25:20 +0200 |
| commit | b94ba9d409abd48b9e01bee8c039e85d951505ab (patch) | |
| tree | c27d4734d351941cb5d01b2145374cd264702b0a /Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs | |
| parent | 5a2809e33725631ed25c0361331060e1821b66de (diff) | |
| parent | c55fde25a54e9d2c2ba0e781d4a6f790990f85bd (diff) | |
Merge remote-tracking branch 'upstream/master' into tmdb-missing-episodes
# Conflicts:
# Jellyfin.Server.Implementations/Item/BaseItemRepository.QueryBuilding.cs
Diffstat (limited to 'Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs b/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs index d70ac672f2..0f166fc6e0 100644 --- a/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs +++ b/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs @@ -40,6 +40,19 @@ public static class ExpressionExtensions } /// <summary> + /// Negates a predicate. + /// </summary> + /// <typeparam name="T">The predicate parameter type.</typeparam> + /// <param name="predicate">The predicate expression to negate.</param> + /// <returns>A new expression representing the negation of the input predicate.</returns> + public static Expression<Func<T, bool>> Not<T>(this Expression<Func<T, bool>> predicate) + { + ArgumentNullException.ThrowIfNull(predicate); + + return Expression.Lambda<Func<T, bool>>(Expression.Not(predicate.Body), predicate.Parameters); + } + + /// <summary> /// Combines two predicates into a single predicate using a logical AND operation. /// </summary> /// <typeparam name="T">The predicate parameter type.</typeparam> |
