diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-03 23:06:05 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-03 23:06:05 +1000 |
| commit | 7c33b3f334cf91918add7af08866f2ea37ed9c3f (patch) | |
| tree | 8095a2d65e87a808fac62b47e315a4875cc86b73 /src/marlin.web/Util/IQueryableExtensions.cs | |
chore: initial commit
Diffstat (limited to 'src/marlin.web/Util/IQueryableExtensions.cs')
| -rw-r--r-- | src/marlin.web/Util/IQueryableExtensions.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/marlin.web/Util/IQueryableExtensions.cs b/src/marlin.web/Util/IQueryableExtensions.cs new file mode 100644 index 0000000..79b9cbe --- /dev/null +++ b/src/marlin.web/Util/IQueryableExtensions.cs @@ -0,0 +1,14 @@ +namespace marlin.web.Util; + +using System.Linq.Expressions; + +public static class IQueryableExtensions +{ + public static IQueryable<T> WhereIf<T>( + this IQueryable<T> self, + bool cond, + Expression<Func<T, bool>> predicate) + { + return cond ? self.Where(predicate) : self; + } +}
\ No newline at end of file |
