From 8bf8cdce5e719e69eec8bcf32878b25d98773894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AC=9D=E6=A1=82=E7=B6=B1?= Date: Tue, 1 Mar 2016 20:48:23 +0800 Subject: [PATCH] finish the linq compiler needs improves the statement parser --- .../Framewok/DynamicCode/vbc/DynamicCompiler.vb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/LINQ/LINQ/Framewok/DynamicCode/vbc/DynamicCompiler.vb b/LINQ/LINQ/Framewok/DynamicCode/vbc/DynamicCompiler.vb index b983321..42798d4 100644 --- a/LINQ/LINQ/Framewok/DynamicCode/vbc/DynamicCompiler.vb +++ b/LINQ/LINQ/Framewok/DynamicCode/vbc/DynamicCompiler.vb @@ -43,6 +43,19 @@ Namespace Framework.DynamicCode.VBC Next End Sub + ''' + ''' 编译Linq代码 + ''' + ''' + ''' + Public Function Compile(LinqClosure As String, Optional ByRef err As String = "") As IProject + Dim lstImports = ImportsNamespace.ToArray(Function(ns) "Imports " & ns) + Dim code As String = lstImports.JoinBy(vbCrLf) & vbCrLf & LinqClosure + Dim dll = CreateParameters(ReferenceList, EntityProvider.SDK) + Dim assm As Assembly = CompileCode(code, dll, err) + Return assm.GetProjectAbstract + End Function + Public Function Compile([declare] As CodeTypeDeclaration) As Type Dim assmUnit As CodeCompileUnit = DeclareAssembly() Dim ns As CodeNamespace = assmUnit.Namespaces.Item(0)