summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:35:25 +0000
commit674ca83ba9243a9e95a7568c797668dab6aee26a (patch)
tree4a905b3fb1d827665a34d63f67bc5559f8e7235b /Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs
downloadgestor-674ca83ba9243a9e95a7568c797668dab6aee26a.tar.gz
gestor-674ca83ba9243a9e95a7568c797668dab6aee26a.zip
feat: upload files
Diffstat (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs')
-rw-r--r--Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs
new file mode 100644
index 0000000..1848882
--- /dev/null
+++ b/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Infrastructure.Helpers
+{
+ public static class QueryableHelper
+ {
+ public static IQueryable<TSource> WhereNotEmpty<TSource, T>(this IQueryable<TSource> source, T compareVaue, Expression<Func<TSource, bool>> predicateIf, Expression<Func<TSource, bool>> predicateElse = null)
+ {
+ //
+ // Current member / type: System.Linq.IQueryable`1<TSource> Gestor.Infrastructure.Helpers.QueryableHelper::WhereNotEmpty(System.Linq.IQueryable`1<TSource>,T,System.Linq.Expressions.Expression`1<System.Func`2<TSource,System.Boolean>>,System.Linq.Expressions.Expression`1<System.Func`2<TSource,System.Boolean>>)
+ // File path: C:\AggerSeguros\Lib\Gestor.Infrastructure.dll
+ //
+ // Product version: 0.0.0.0
+ // Exception in: System.Linq.IQueryable<TSource> WhereNotEmpty(System.Linq.IQueryable<TSource>,T,System.Linq.Expressions.Expression<System.Func<TSource,System.Boolean>>,System.Linq.Expressions.Expression<System.Func<TSource,System.Boolean>>)
+ //
+ // Managed pointer usage not in SSA
+ // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.CheckForAssignment(BinaryExpression node) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 100
+ // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.VisitBinaryExpression(BinaryExpression node) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 80
+ // at Telerik.JustDecompiler.Ast.BaseCodeVisitor.Visit(ICodeNode node) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Ast\BaseCodeVisitor.cs:line 351
+ // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.VisitExpressions() in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 41
+ // at Telerik.JustDecompiler.Steps.ManagedPointersRemovalStep.Process(DecompilationContext context, BlockStatement body) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Steps\ManagedPointersRemovalStep.cs:line 29
+ // at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.RunInternal(MethodBody body, BlockStatement block, ILanguage language) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\DecompilationPipeline.cs:line 100
+ // at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\DecompilationPipeline.cs:line 72
+ // at Telerik.JustDecompiler.Decompiler.Extensions.RunPipeline(DecompilationPipeline pipeline, ILanguage language, MethodBody body, DecompilationContext& context) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\Extensions.cs:line 95
+ // at Telerik.JustDecompiler.Decompiler.Extensions.Decompile(MethodBody body, ILanguage language, DecompilationContext& context, TypeSpecificContext typeContext) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\Extensions.cs:line 61
+ // at Telerik.JustDecompiler.Decompiler.WriterContextServices.BaseWriterContextService.DecompileMethod(ILanguage language, MethodDefinition method, TypeSpecificContext typeContext) in D:\a\CodemerxDecompile\CodemerxDecompile\src\JustDecompileEngine\src\JustDecompiler.Shared\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 118
+ //
+ // mailto: JustDecompilePublicFeedback@telerik.com
+
+ }
+
+ public static IQueryable<TSource> WhereTrue<TSource>(this IQueryable<TSource> source, bool compareVaue, Expression<Func<TSource, bool>> predicateIf, Expression<Func<TSource, bool>> predicateElse = null)
+ {
+ if (compareVaue)
+ {
+ return source.Where<TSource>(predicateIf);
+ }
+ if (predicateElse == null)
+ {
+ return source;
+ }
+ return source.Where<TSource>(predicateElse);
+ }
+ }
+} \ No newline at end of file