Skip to content

Commit

Permalink
Merge branch 'feature/Inline_native-transformation_with_variables_(#436
Browse files Browse the repository at this point in the history
…)' of https://github.com/Seddryck/NBi into feature/Inline_native-transformation_with_variables_(#436)

# Conflicts:
#	NBi.NUnit/Builder/Helper/ScalarResolverArgsBuilder.cs
  • Loading branch information
Cédric L. Charlier committed Feb 13, 2019
1 parent 459e2b7 commit b80cbd0
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/CSharpScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,7 @@ public static object Function()
Type function = results.CompiledAssembly.GetType("NBi.Core.Variable.Dynamic.VariableClass");
return function.GetMethod("Function");
}

object IScalarResolver.Execute() => Execute();
}
}
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/EnvironmentScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ public T Execute()
var value = Environment.GetEnvironmentVariable(args.Name, EnvironmentVariableTarget.User);
return (T)Convert.ChangeType(value, typeof(T));
}

object IScalarResolver.Execute() => Execute();
}
}
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/FormatScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ public string Execute()
var value = formatter.Execute(args.Text);
return value;
}

object IScalarResolver.Execute() => Execute();
}
}
5 changes: 4 additions & 1 deletion NBi.Core/Scalar/Resolver/FunctionScalarResolverArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class FunctionScalarResolverArgs : IScalarResolverArgs
public IEnumerable<INativeTransformation> Transformations { get; }

public FunctionScalarResolverArgs(IScalarResolver resolver, IEnumerable<INativeTransformation> transformations)
=> (Resolver, Transformations) = (resolver, transformations);
{
Resolver = resolver;
Transformations = transformations;
}
}
}
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/GlobalVariableScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public T Execute()
return (T)typedEvaluation;
}

object IScalarResolver.Execute() => Execute();

private void DisplayVariable(string name, object value)
{
var invariantCulture = new CultureFactory().Invariant;
Expand Down
7 changes: 6 additions & 1 deletion NBi.Core/Scalar/Resolver/IScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

namespace NBi.Core.Scalar.Resolver
{
public interface IScalarResolver<T>
public interface IScalarResolver
{
object Execute();
}

public interface IScalarResolver<T> : IScalarResolver
{
T Execute();
}
Expand Down
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/LiteralScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ public T Execute()
Trace.WriteLineIf(Extensibility.NBiTraceSwitch.TraceVerbose, $"Literal evaluated to: {output}");
return (T)output;
}

object IScalarResolver.Execute() => Execute();
}
}
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/ProjectionResultSetScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ public T Execute()

return (T)Convert.ChangeType(projectionResult, typeof(T));
}

object IScalarResolver.Execute() => Execute();
}
}
2 changes: 2 additions & 0 deletions NBi.Core/Scalar/Resolver/QueryScalarResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ public T Execute()
var value = ExecuteQuery(cmd);
return (T)Convert.ChangeType(value, typeof(T));
}

object IScalarResolver.Execute() => Execute();
}
}

0 comments on commit b80cbd0

Please sign in to comment.