olivier-spinelli
released this
22 Jul 15:53
·
251 commits
to master
since this release
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'" ) );