public void ProcessRequest(HttpContext context) { var dispatcher = new DefaultDispatcher(); var parameter = dispatcher.Query(new GetMvdParameterQuery() { Params = context.Request.Params }); context.Response.ContentType = "application/json"; context.Response.ContentEncoding = Encoding.UTF8; var instanceForQuery = dispatcher.Query(new CreateByTypeQuery() { Type = parameter.Type }); context.Response.Write(IncodingResult.Success(dispatcher.Query(new MVDExecute(new HttpContextWrapper(context)) { Instance = new CommandComposite((IMessage)instanceForQuery) })).ToJsonString()); }
public void ProcessRequest(HttpContext context) { var dispatcher = new DefaultDispatcher(); var parameter = dispatcher.Query(new GetMvdParameterQuery() { Params = context.Request.Params }); var commands = dispatcher.Query(new CreateByTypeQuery.AsCommands() { IncTypes = parameter.Type, IsComposite = parameter.IsCompositeArray }); context.Response.ContentType = "application/json"; context.Response.ContentEncoding = Encoding.UTF8; dispatcher.Push(new CommandComposite(commands)); var data = commands.Length == 1 ? commands[0].Result : commands.Select(r => r.Result); context.Response.Write(IncodingResult.Success(data).ToJsonString()); }