示例#1
0
 /// <summary>
 /// Etablish a connection to the <see cref="IQueryRemoteHandler">Remote Service</see>.
 /// </summary>
 public void Connect()
 {
     if (handler == null)
     {
         handler = connectMethod();
     }
 }
示例#2
0
 /// <summary>
 /// Etablish a connection to the <see cref="IQueryRemoteHandler">Remote Service</see>.
 /// </summary>
 public void Connect()
 {
     if (handler == null)
     {
         handler = connectMethod();
     }
 }
示例#3
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="innerHandler">Inner Handler of this Server.</param>
 public ServerQueryRemotingHandler(IQueryHandler innerHandler)
 {
     if (innerHandler == null)
     {
         throw new ArgumentNullException("innerHandler");
     }
     InnerHandler = new ServerQueryHandler(innerHandler);
 }
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="queryRemoteHandler"><see cref="IQueryRemoteHandler"/> to communicate with the server.</param>
 public ClientQueryProvider(IQueryRemoteHandler queryRemoteHandler)
 {
     if (queryRemoteHandler == null)
     {
         throw new ArgumentNullException("queryRemoteHandler");
     }
     Handler = queryRemoteHandler;
 }
示例#5
0
        /// <summary>
        /// Creates ZyanServerQueryHandler instance.
        /// </summary>
        /// <param name="source">IEntitySource instance</param>
        public ZyanServerQueryHandler(IEntitySource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            InnerHandler = new ServerQueryHandler(new ZyanEntityQueryHandler(source));
        }
示例#6
0
        /// <summary>
        /// Creates ZyanServerQueryHandler instance.
        /// </summary>
        /// <param name="handler">IQueryable delegate</param>
        public ZyanServerQueryHandler(Func <Type, IQueryable> handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            InnerHandler = new ServerQueryHandler(new ZyanEntityQueryHandler(handler));
        }
示例#7
0
 /// <summary>
 /// Retrieves data from the server by an <see cref="SerializableExpression">Expression</see> tree.
 /// </summary>
 /// <remarks>
 /// This method's return type depends on the submitted
 /// <see cref="SerializableExpression">Expression</see> tree.
 /// Here some examples ('T' is the requested type):
 /// <list type="list">
 ///     <listheader>
 ///         <term>Method</term>
 ///         <description>Return Type</description>
 ///     </listheader>
 ///     <item>
 ///         <term>Select(...)</term>
 ///         <description>T[]</description>
 ///     </item>
 ///     <item>
 ///         <term>First(...), Last(...)</term>
 ///         <description>T</description>
 ///     </item>
 ///     <item>
 ///         <term>Count(...)</term>
 ///         <description><see langword="int"/></description>
 ///     </item>
 ///     <item>
 ///         <term>Contains(...)</term>
 ///         <description><see langword="bool"/></description>
 ///     </item>
 /// </list>
 /// </remarks>
 /// <param name="expression">
 ///     <see cref="SerializableExpression">Expression</see> tree
 ///     containing selection and projection.
 /// </param>
 /// <returns>Returns requested data.</returns>
 /// <seealso cref="IQueryRemoteHandler.Retrieve"/>
 public object Retrieve(SerializableExpression expression)
 {
     try
     {
         return(Handler.Retrieve(expression));
     }
     catch (FaultException ex)
     {
         Console.WriteLine("Test Failed on server.");
         handler = null;
         throw new Exception("The execution of the query failed on the server. See inner exception for more details.", ex);
     }
     catch (Exception)
     {
         Console.WriteLine("Test Failed.");
         handler = null;
         throw;
     }
 }
示例#8
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="queryRemoteHandler"><see cref="IQueryRemoteHandler"/> to communicate with the server.</param>
 public ClientQueryHandler(IQueryRemoteHandler queryRemoteHandler)
 {
     this.queryRemoteHandler = queryRemoteHandler;
 }
 protected override void RegisterService(IQueryRemoteHandler serviceHandler)
 {
     registeredService = serviceHandler;
 }
示例#10
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="queryRemoteHandlerInstance"><see cref="IQueryRemoteHandler"/> to communicate with the server.</param>
 public ClientQueryHandler(IQueryRemoteHandler queryRemoteHandlerInstance)
 {
     QueryRemoteHandlerInstance = queryRemoteHandlerInstance;
 }
示例#11
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 /// <param name="queryRemoteHandler"><see cref="IQueryRemoteHandler"/> to communicate with the server.</param>
 public ClientQueryHandler(IQueryRemoteHandler queryRemoteHandler)
 {
     this.queryRemoteHandler = queryRemoteHandler;
 }
示例#12
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 protected ServerQueryRemotingHandler()
 {
     InnerHandler = GetRegisteredService();
 }
示例#13
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 protected ServerQueryRemotingHandler()
 {
     // ReSharper disable DoNotCallOverridableMethodsInConstructor
     InnerHandler = GetRegisteredService();
     // ReSharper restore DoNotCallOverridableMethodsInConstructor
 }
示例#14
0
 /// <summary>
 /// Retrieves data from the server by an <see cref="SerializableExpression">Expression</see> tree.
 /// </summary>
 /// <remarks>
 /// This method's return type depends on the submitted 
 /// <see cref="SerializableExpression">Expression</see> tree.
 /// Here some examples ('T' is the requested type):
 /// <list type="list">
 ///     <listheader>
 ///         <term>Method</term>
 ///         <description>Return Type</description>
 ///     </listheader>
 ///     <item>
 ///         <term>Select(...)</term>
 ///         <description>T[]</description>
 ///     </item>
 ///     <item>
 ///         <term>First(...), Last(...)</term>
 ///         <description>T</description>
 ///     </item>
 ///     <item>
 ///         <term>Count(...)</term>
 ///         <description><see langword="int"/></description>
 ///     </item>
 ///     <item>
 ///         <term>Contains(...)</term>
 ///         <description><see langword="bool"/></description>
 ///     </item>
 /// </list>
 /// </remarks>
 /// <param name="expression">
 ///     <see cref="SerializableExpression">Expression</see> tree 
 ///     containing selection and projection.
 /// </param>
 /// <returns>Returns requested data.</returns>
 /// <seealso cref="IQueryRemoteHandler.Retrieve"/>
 public object Retrieve(SerializableExpression expression)
 {
     try
     {
         return Handler.Retrieve(expression);
     }
     catch (FaultException ex)
     {
         Console.WriteLine("Test Failed on server.");
         handler = null;
         throw new Exception("The execution of the query failed on the server. See inner exception for more details.", ex);
     }
     catch (Exception)
     {
         Console.WriteLine("Test Failed.");
         handler = null;
         throw;
     }
 }
示例#15
0
 /// <summary>
 /// Registers the <see cref="IQueryRemoteHandler"/> as service.
 /// </summary>
 /// <param name="serviceHandler"><see cref="IQueryRemoteHandler"/> to register.</param>
 protected virtual void RegisterService(IQueryRemoteHandler serviceHandler)
 {
     _serviceInstance = serviceHandler;
 }
 protected override void RegisterService(IQueryRemoteHandler serviceHandler)
 {
     registeredService = serviceHandler;
 }
示例#17
0
 /// <summary>
 /// Registers the <see cref="IQueryRemoteHandler"/> as service.
 /// </summary>
 /// <param name="serviceHandler"><see cref="IQueryRemoteHandler"/> to register.</param>
 protected virtual void RegisterService(IQueryRemoteHandler serviceHandler)
 {
     serviceInstance = serviceHandler;
 }