Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

LuExpressionParamReplaceVisitor.cs 870B

12345678910111213141516171819202122232425262728
  1. using System.Linq.Expressions;
  2. using Luticate2.Auth.Utils.Dbo;
  3. using Luticate2.Auth.Utils.Dbo.Result;
  4. using Luticate2.Auth.Utils.Exceptions;
  5. namespace Luticate2.Auth.Utils.Business.ExpressionConverter
  6. {
  7. public class LuExpressionParamReplaceVisitor : ExpressionVisitor
  8. {
  9. public LuExpressionConverterOptions Options { get; }
  10. public LuExpressionParamReplaceVisitor(LuExpressionConverterOptions options)
  11. {
  12. Options = options;
  13. }
  14. protected override Expression VisitParameter(ParameterExpression node)
  15. {
  16. if (!Options.Parameters.ContainsKey(node))
  17. {
  18. LuResult<Expression>.Error(LuStatus.InternalError.ToInt(),
  19. $"Could not find a conversion for parameter {node}").Throw();
  20. }
  21. return Options.Parameters[node];
  22. }
  23. }
  24. }