Releases: Invenietis/yodii-script
Releases · Invenietis/yodii-script
Support for native function and namespaces.
This release extends GlobalContext to support:
- Registration of any delegate.
- Registration of objects can be done in "namespace"
var c = new GlobalContext();
Func<string, string> func = s => "N'" + s.Replace( "'", "''" ) + "'";
c.Register( "SqlHelper.ToSqlNString", func );
Assert.That( ScriptEngine.Evaluate( @" 'hop = ' + SqlHelper.ToSqlNString( ""Aujourd'hui"" )", c ).ToString(),
Is.EqualTo( "hop = N'Aujourd''hui'" ) );