예제 #1
0
 public ChunkedResult(T res, RIAPPInterface.ISerializer serializer)
 {
     this.Data        = res;
     this._serializer = serializer;
     this.ContentType = ResultContentType;
     this.StatusCode  = HttpStatusCode.OK;
     this.Contents    = this.ExecuteResult();
 }
예제 #2
0
 public IncrementalResult(QueryResponse res, RIAPPInterface.ISerializer serializer)
 {
     this.Data = res;
     this._serializer = serializer;
     this.ContentType = System.Net.Mime.MediaTypeNames.Text.Plain;
     this.StatusCode = HttpStatusCode.OK;
     this.Contents = this.ExecuteResult();
 }
예제 #3
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing && this._DomainService.IsValueCreated)
     {
         this._DomainService.Value.Dispose();
     }
     this._DomainService = null;
     this._serializer    = null;
 }
예제 #4
0
        public RIAPPSvcModule(string modulePath)
            : base(modulePath)
        {
            this._serializer    = new Serializer();
            this._DomainService = new Lazy <IDomainService>(() => this.CreateDomainService(), true);

            Get["/code"] = x =>
            {
                return(new TextResponse(this.GetCode(this.Context.Request.Query.lang)));
            };

            Get["/permissions"] = x =>
            {
                return(this.GetPermissionsInfo());
            };

            Post["/query", runAsync : true] = async(parameters, ct) =>
            {
                var request = this.DeSerialize <QueryRequest>(this.Context.Request.Body);
                return(await this.PerformQuery(request));
            };

            Post["/save", runAsync : true] = async(parameters, ct) =>
            {
                var request = this.DeSerialize <ChangeSet>(this.Context.Request.Body);
                return(await this.Save(request));
            };

            Post["/refresh", runAsync : true] = async(parameters, ct) =>
            {
                var request = this.DeSerialize <RefreshInfo>(this.Context.Request.Body);
                return(await this.Refresh(request));
            };

            Post["/invoke", runAsync : true] = async(parameters, ct) =>
            {
                var request = this.DeSerialize <InvokeRequest>(this.Context.Request.Body);;
                return(await this.Invoke(request));
            };
        }