Beispiel #1
0
        private static void ConfigureLinqForContext(DbContext context, string configName, out Type contextType)
        {
            contextType = context.GetType();
            var nameSpace    = contextType.Namespace;
            var assemblyName = contextType.Assembly.FullName;

            NativeScriptHelper.AddReference(configName, assemblyName);
            NativeScriptHelper.AddUsing(configName, nameSpace);
        }
Beispiel #2
0
 static ContextExtensions()
 {
     NativeScriptHelper.AddReference(RosFkConfig, "--ROSLYN--");
     NativeScriptHelper.AddReference(RosFkConfig, "ITVComponents.WebCoreToolkit.EntityFramework");
     NativeScriptHelper.AddUsing(RosFkConfig, "ITVComponents.WebCoreToolkit.EntityFramework.Models");
     NativeScriptHelper.AddUsing(RosFkConfig, "ITVComponents.WebCoreToolkit.EntityFramework.Helpers");
     NativeScriptHelper.AddUsing(RosFkConfig, "ITVComponents.Helpers");
     NativeScriptHelper.RunLinqQuery(RosFkConfig, new[] { "Fubar" }, "Fubar", "return null;", new Dictionary <string, object>());
     NativeScriptHelper.AddReference(RosDiagConfig, "--ROSLYN--");
     NativeScriptHelper.AddReference(RosDiagConfig, "ITVComponents.WebCoreToolkit.EntityFramework");
     NativeScriptHelper.AddReference(RosDiagConfig, "ITVComponents.Decisions.Entities");
     NativeScriptHelper.AddUsing(RosDiagConfig, "ITVComponents.WebCoreToolkit.EntityFramework.Models");
     NativeScriptHelper.AddUsing(RosDiagConfig, "ITVComponents.Decisions");
     NativeScriptHelper.AddUsing(RosDiagConfig, "ITVComponents.Decisions.Entities.Results");
     NativeScriptHelper.RunLinqQuery(RosDiagConfig, new[] { "Fubar" }, "Fubar", "return null;", new Dictionary <string, object>());
 }
Beispiel #3
0
        public void NativeTests()
        {
            var test = new TestClass();

            NativeScriptHelper.AddReference("DUMMY", "--ROSLYN--");
            ExpressionParser.Parse("TestString = `E(\"A\" as hicks -> DUMMY)::\"return Global.GoFuckYourself();\" with {GoFuckYourself:function(){return \"hallo\";}}", test, s => DefaultCallbacks.PrepareDefaultCallbacks(s.Scope, s.ReplSession));
            Assert.AreEqual(test.TestString, "hallo");
            ExpressionParser.Parse(@"TestString = `E(#DUMMY)::@#
int a = -1;
for (int i = 0; i< 100000; i++){
    a += 10;
    a = a%71;
}

return Global.GoFuckYourself(a);
# with {GoFuckYourself:function(val){return 'System.String'.Format(""velo{0}"",val);}}", test, s => DefaultCallbacks.PrepareDefaultCallbacks(s.Scope, s.ReplSession));
            Assert.AreEqual(test.TestString, "velo35");
        }