Esempio n. 1
0
 /// <summary>
 /// Etablish a connection to the <see cref="IQueryRemoteHandler">Remote Service</see>.
 /// </summary>
 public void Connect()
 {
     if (handler == null)
     {
         handler = connectMethod();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Etablish a connection to the <see cref="IQueryRemoteHandler">Remote Service</see>.
 /// </summary>
 public void Connect()
 {
     if (handler == null)
     {
         handler = connectMethod();
     }
 }
Esempio n. 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;
 }
Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 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;
     }
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 12
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 protected ServerQueryRemotingHandler()
 {
     InnerHandler = GetRegisteredService();
 }
Esempio n. 13
0
 /// <summary>
 /// Initializes this class.
 /// </summary>
 protected ServerQueryRemotingHandler()
 {
     // ReSharper disable DoNotCallOverridableMethodsInConstructor
     InnerHandler = GetRegisteredService();
     // ReSharper restore DoNotCallOverridableMethodsInConstructor
 }
Esempio n. 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;
     }
 }
Esempio n. 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;
 }
Esempio n. 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;
 }