From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../QueryableHelper.cs | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs (limited to 'Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs') diff --git a/Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs b/Codemerx/Gestor.Infrastructure/Gestor.Infrastructure.Helpers/QueryableHelper.cs new file mode 100644 index 0000000..1848882 --- /dev/null +++ b/Codemerx/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 WhereNotEmpty(this IQueryable source, T compareVaue, Expression> predicateIf, Expression> predicateElse = null) + { + // + // Current member / type: System.Linq.IQueryable`1 Gestor.Infrastructure.Helpers.QueryableHelper::WhereNotEmpty(System.Linq.IQueryable`1,T,System.Linq.Expressions.Expression`1>,System.Linq.Expressions.Expression`1>) + // File path: C:\AggerSeguros\Lib\Gestor.Infrastructure.dll + // + // Product version: 0.0.0.0 + // Exception in: System.Linq.IQueryable WhereNotEmpty(System.Linq.IQueryable,T,System.Linq.Expressions.Expression>,System.Linq.Expressions.Expression>) + // + // 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 WhereTrue(this IQueryable source, bool compareVaue, Expression> predicateIf, Expression> predicateElse = null) + { + if (compareVaue) + { + return source.Where(predicateIf); + } + if (predicateElse == null) + { + return source; + } + return source.Where(predicateElse); + } + } +} \ No newline at end of file -- cgit v1.2.3