diff --git a/LICENSE b/LICENSE
index 87a5df2..3bd0c8d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Need more precision? info@zzzprojects.com
+Need more precision? info@zzzprojects.com
DUAL LICENSING - Copyright © ZZZ Projects Inc. 2014 - 2016
diff --git a/README.md b/README.md
index 9e7dbc2..5d11721 100644
--- a/README.md
+++ b/README.md
@@ -1,185 +1,164 @@
-##Evaluate C# code and expression in T-SQL stored procedure, function and trigger##
-
-**Extend SQL with the full C# Syntax and get the best of both languages:**
-
-- Access to .NET features and objects
- - LINQ
- - Math
- - Regex
- - String Interpolation
- - Web Service
-- Evaluate expression at runtime
- - Use column value as formula
- - Use column value as parameter
-- Perform File Operation
- - Replace xp_cmdshell with C# Syntax
- - Use DirectoryInfo, FileInfo
- - Impersonate context
-- T-SQL Function Enhancement
- - Error Handling (Try/Catch)
- - Call stored procedure
- - Modify Table State
- - Run dynamic SQL
-
-
+# What's Eval-SQL.Net?
+Eval SQL.NET is a library that allows evaluating C# expression dynamically directly in T-SQL.
+
+It provides to your SQL Server all missing pieces like regular expression and dynamic arithmetic string evaluation.
+
```sql
--- Evaluate dynamically expression in T-SQL
-DECLARE @tableFormula TABLE (
- Formula VARCHAR(255), X INT, Y INT, Z INT
-)
-
-INSERT INTO @tableFormula VALUES ('x+y*z', 1, 2, 3 ),
- ('(x+y)*z', 1, 2, 3 )
--- SELECT 7
--- SELECT 9
-SELECT SQLNET::New(Formula)
- .Val('x', X)
- .Val('y', Y)
- .Val('z', Z).EvalInt()
-FROM @tableFormula
+-- SELECT 3
+SELECT SQLNET::New('x+y').ValueInt('x', 1).ValueInt('y', 2).EvalInt() as Result
```
+**Try it online**
+
+**Find your solutions:**
+- Dynamic Arithmetic Expression
+- Dynamic Pivot Table
+- Regular Expression
+- String Interpolation
+- Replace xp_cmdshell with DirectoryInfo & FileInfo
+
+## Performance & Scalability
+Performance tuning is one of the most important tasks for a DBA. Don’t miss the chance to **dramatically improve query performance** by **300%** for simple expression and more than **2000%** for complex code over User-Defined Function (UDF) and Table-Valued Function (TVF).
+
+_Benchmark to split string with delimiters in SQL_
+
+| Methods | 1,000 rows | 10,000 rows | 100,000 rows | 1,000,000 rows |
+| ------------- | ---------: | ----------: | -----------: | -------------: |
+|Eval-SQL.NET | 4 ms | 13 ms | 160 ms | 1,650 ms |
+|fn_split (TVF) | 100 ms | 625 ms | 5,500 ms | 55,000 ms |
## Download
-**[SQLNET.zip](https://github.com/zzzprojects/Eval-SQL.NET/releases)**
+**[Eval-SQL.NET-Install.sql](https://github.com/zzzprojects/Eval-SQL.NET/releases)**
-_Minimum Requirements_
-- SQL CLR Permission Level: **SAFE**
-- SQL 2012
-- .NET Framework 4.0
+_* PRO Version unlocked for the current month_
-Stay updated with latest changes
+_Minimum Requirements:_
+- SQL 2012 / SQL Azure v12
+- SAFE Permission (SQL CLR)
-
-
+## Evaluate dynamic arithmetic/math expression in SQL
+_Make the impossible now possible. Evaluate C# expression in SQL to overcome limitations._
-## SQL Server Eval
-Dynamically evaluate arithmetic operation and expression in SQL
+- Allow trusted users to create report field and filter
+- Consume Web Service
+- Replace text in the template with String Interpolation
-```sql
-CREATE PROCEDURE [dbo].[Select_Switch] @x INT, @y INT, @z INT
-AS
- BEGIN
- DECLARE @result INT
-
- SET @result = SQLNET::New('
-switch(x)
-{
- case 1: return y + z;
- case 2: return y - z;
- case 3: return y * z;
- default: return Convert.ToInt32(y ^^ z); // Pow
-}
- ').Val('x', @x).Val('y', @y).Val('z', @z).EvalInt()
-
- SELECT @result
- END
-
-GO
-
--- RETURN 5
-EXEC Select_Switch 1, 2, 3
--- RETURN -1
-EXEC Select_Switch 2, 2, 3
--- RETURN 6
-EXEC Select_Switch 3, 2, 3
--- RETURN 8
-EXEC Select_Switch 4, 2, 3
+```csharp
+-- CREATE test
+DECLARE @table TABLE ( X INT, Y INT, Z INT )
+INSERT INTO @table VALUES ( 2, 4, 6 ), ( 3, 5, 7 ), ( 4, 6, 8 )
+
+-- Result: 14, 22, 32
+DECLARE @sqlnet SQLNET = SQLNET::New('x*y+z')
+SELECT @sqlnet.ValueInt('x', X)
+ .ValueInt('y', Y)
+ .ValueInt('z', Z)
+ .EvalInt() as Result
+FROM @table
```
+**Try it online**
-**[Learn more](https://github.com/zzzprojects/Eval-SQL.NET/wiki/SQL-Server-Eval-%7C-Dynamically-evaluate-arithmetic-operation-and-expression-in-SQL)**
+## Split text with delimiter
+_Improve performance and capability for splitting text with an easy to use split function and LINQ expression_
+- Split text with multiple delimiters
+- Split text using a regular expression
+- Include row index
-## SQL Server Regex
-Use regular expression to search, replace and split text in SQL
+```
+-- CREATE test
+DECLARE @t TABLE (Id INT , Input VARCHAR(MAX))
+INSERT INTO @t VALUES ( 1, '1, 2, 3; 4; 5' ), ( 2, '6;7,8;9,10' )
+
+-- SPLIT with many delimiters: ',' and ';'
+DECLARE @sqlnet SQLNET = SQLNET::New('Regex.Split(input, ",|;")')
+
+SELECT *
+FROM @t AS A
+ CROSS APPLY ( SELECT *
+ FROM dbo.SQLNET_EvalTVF_1(@sqlnet.ValueString('input', Input))
+ ) AS B
+```
+**Try it online**
+
+## Use regular expression in SQL Server
+_Use Regex flexibility to overcome “LIKE” and “PATHINDEX” limitations._
+- IsMatch
+- Match
+- Matches
+- Replace
+- Split
```sql
-CREATE FUNCTION [dbo].[fn_Split]
- (
- @input VARCHAR(MAX) ,
- @pattern VARCHAR(8000) = ','
- )
-RETURNS @split TABLE ( item VARCHAR(8000) )
- BEGIN
- DECLARE @regex_split SQLNET = SQLNET::New('Regex.Split(input, pattern)')
- .ValueString('input', @input)
- .Val('pattern', @pattern)
-
- INSERT INTO @split
- SELECT CAST(Value_1 AS VARCHAR(8000))
- FROM [dbo].[SQLNET_EvalTVF_1](@regex_split)
- RETURN
- END
-
-GO
-
--- SPLIT with multiple delimiters (',' and ';')
-SELECT * FROM dbo.fn_Split('1, 2, 3; 4; 5', ',|;')
-```
+DECLARE @customer TABLE ( Email VARCHAR(255) )
-**[Learn more](https://github.com/zzzprojects/Eval-SQL.NET/wiki/SQL-Server-Regex-%7C-Use-regular-expression-to-search,-replace-and-split-text-in-SQL)**
+INSERT INTO @customer
+VALUES ( 'info@zzzprojects.com' ),
+ ( 'invalid.com' ),
+ ( 'sales@zzzprojects.com' )
-## SQL Server File Operation
-xp_cmdshell alternative to read and write files in SQL
+DECLARE @valid_email SQLNET = SQLNET::New('Regex.IsMatch(email,
+@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$")')
-```sql
+-- SELECT 'invalid.com'
+SELECT * FROM @customer WHERE @valid_email.ValueString('email', Email).EvalBit() = 0
+```
+**Try it online**
+
+## Replace xp_cmdshell with restrictive alternative
+_Avoid enabling xp_cmdshell and compromising your SQL Server and use a more restrictive solution instead._
+- Impersonate Context
+- Improve maintainability
+- Improve readability
+- Improve security
+
+```csharp
-- REQUIRE EXTERNAL_ACCESS permission
DECLARE @sqlnet SQLNET = SQLNET::New('
string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var dir = new DirectoryInfo(path);
-return dir.GetFiles("*.*").Select(x => x.FullName).OrderBy(x => x).ToList();')
- .Impersonate()
+return dir.GetFiles("*.*")
+ .Select(x => new { x.FullName, FileContent = File.ReadAllText(x.FullName) })
+ .OrderBy(x => x.FullName)')
+ .Impersonate()
--- SELECT * FROM DesktopFiles ORDER BY File.Fullname
+-- SELECT FullName, FileContext FROM DesktopFiles ORDER BY Fullname
EXEC dbo.SQLNET_EvalResultSet @sqlnet
```
-**[Learn more](https://github.com/zzzprojects/Eval-SQL.NET/wiki/SQL-Server-File-Operation-%7C-xp_cmdshell-alternative-to-read-and-write-files-in-SQL)**
-
## FREE vs PRO
-Every month, a **[FREE trial](https://github.com/zzzprojects/Eval-SQL.NET/releases)** of the PRO version is available to let you evaluate all its features without limitations.
-
-Features | FREE Version | PRO Version
------------- | :-------------: | :-------------:
-Maximum Characters | 50 | Unlimited
-Commercial License | No | Yes
-Support & Upgrades (1 year) | No | Yes
+Features | **[PRO Version](http://eval-sql.net/#pro)**
+------------ | :-------------:
+Maximum Characters | Unlimited
+Commercial License | Yes
+Support & Upgrades (1 year) | Yes
Learn more about the **[PRO Version](http://eval-sql.net/#pro)**
-## Contribution
-
-Supporting & developing FREE features takes **hundreds** and **thousands** of hours! If you like our product please consider making a donation to keep us running.
+## Contribute
-
+The best way to contribute is by **spreading the word** about the library:
-Contribution isn't all about money!
- Blog it
- Comment it
- - Fork it
- Star it
- Share it
-
-A **HUGE thanks** for your extra support.
+
+A **HUGE THANKS** for your help.
## More Projects
-**Entity Framework**
-- [Entity Framework Extensions](http://www.zzzprojects.com/products/dotnet-development/entity-framework-extensions/)
-- [Entity Framework Plus](https://github.com/zzzprojects/EntityFramework-Plus)
-
-**Bulk Operations**
-- [NET Entity Framework Extensions](http://www.zzzprojects.com/products/dotnet-development/entity-framework-extensions/)
-- [NET Bulk Operations](http://www.zzzprojects.com/products/dotnet-development/bulk-operations/)
-
-**Expression Evaluator**
-- [Eval SQL.NET](https://github.com/zzzprojects/Eval-SQL.NET)
-- [Eval Expression.NET](https://github.com/zzzprojects/Eval-Expression.NET)
-
-**Others**
-- [Extension Methods Library](https://github.com/zzzprojects/Z.ExtensionMethods/)
-- [LINQ Async](https://github.com/zzzprojects/Linq-AsyncExtensions)
-
-**Need more info?** info@zzzprojects.com
-
-Contact our outstanding customer support for any request. We usually answer within the next business day, hour, or minutes!
+- Projects:
+ - [EntityFramework Extensions](https://entityframework-extensions.net/)
+ - [Dapper Plus](https://dapper-plus.net/)
+ - [C# Eval Expression](https://eval-expression.net/)
+- Learn Websites
+ - [Learn EF Core](https://www.learnentityframeworkcore.com/)
+ - [Learn Dapper](https://www.learndapper.com/)
+- Online Tools:
+ - [.NET Fiddle](https://dotnetfiddle.net/)
+ - [SQL Fiddle](https://sqlfiddle.com/)
+ - [ZZZ Code AI](https://zzzcode.ai/)
+- and much more!
+
+To view all our free and paid projects, visit our website [ZZZ Projects](https://zzzprojects.com/).
diff --git a/src/Z.Expressions.SqlServer.Eval/Eval/Eval.Compile.cs b/src/Z.Expressions.SqlServer.Eval/Eval/Eval.Compile.cs
new file mode 100644
index 0000000..bf314c7
--- /dev/null
+++ b/src/Z.Expressions.SqlServer.Eval/Eval/Eval.Compile.cs
@@ -0,0 +1,168 @@
+// Description: C# Expression Evaluator | Evaluate, Compile and Execute C# code and expression at runtime.
+// Website & Documentation: https://github.com/zzzprojects/Eval-Expression.NET
+// Forum & Issues: https://github.com/zzzprojects/Eval-Expression.NET/issues
+// License: https://github.com/zzzprojects/Eval-Expression.NET/blob/master/LICENSE
+// More projects: http://www.zzzprojects.com/
+// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Z.Expressions
+{
+ public static partial class Eval
+ {
+ /// Compile the code or expression and return a delegate of type Func to execute.
+ /// The code or expression to compile.
+ /// A delegate of type Func that represents the compiled code or expression.
+ public static Func