예제 #1
0
        public T Query <T>()
        {
            var request = new ObjectQueryRequest <T>(this.GetSource(), this.GetSessionId(), this.connectionString.Target);
            var mode    = this.GetMode();

            return(mode.PerformRequest <ObjectQueryResponse <T> >(request).Result);
        }
예제 #2
0
        private IMessage ExecuteHelper <T>(ObjectQueryRequest <T> request)
        {
            IObjectSpaceSimple ts = this.repository.GetSpace(request.Target);

            if (ts != null)
            {
                T result = ts.Query <T>();
                return(new ObjectQueryResponse <T>(request.Source, request.Session, request.Target, result, StatusCode.OK, StatusMessage.OK));
            }
            return(new ObjectQueryResponse <T>(request.Source, request.Session, request.Target, default(T), StatusCode.NOT_FOUND, StatusMessage.NOT_FOUND));
        }