public void ProcessRequest(HttpContext context) { LocalizationHelper.SetThreadCulture(); var typeStr = context.Request["type"]; if (typeStr == null) { throw new ArgumentNullException(string.Empty, "Необходимо передать параметр type"); } var type = BuildManager.GetType(typeStr, true, false); var obj = Activator.CreateInstance(type); var activityController = obj as ActivityController; if (activityController != null) { activityController.Initialize(null, new Dictionary <string, object>()); } var provider = new LinqToJavaScriptProvider(); context.Response.ContentType = "text/javascript"; context.Response.AddHeader("Cache-Control", "private;max-age=32400"); if (method == null) { method = provider.GetType().GetMethod("GetDeclareAllClassScript"); } var execMethod = method.MakeGenericMethod(type); context.Response.Write( execMethod.Invoke(provider, new[] { obj })); }
public LinqToJavaScriptQuery(LinqToJavaScriptProvider provider) { if (provider == null) { throw new ArgumentNullException("provider"); } this.provider = provider; this.expression = Expression.Constant(this); }
public LinqToJavaScriptQuery(LinqToJavaScriptProvider provider, Expression expression) { if (provider == null) { throw new ArgumentNullException("provider"); } if (expression == null) { throw new ArgumentNullException("expression"); } if (!typeof(IQueryable <T>).IsAssignableFrom(expression.Type)) { throw new ArgumentOutOfRangeException("expression"); } this.provider = provider; this.expression = expression; }
internal string GetScriptForCreation() { var provider = new LinqToJavaScriptProvider(); return(provider.GetCreateClassScript(this)); }
protected override string GetScript() { var provider = new LinqToJavaScriptProvider(); return(provider.GetCreateClassScript(ActivityController)); }