/// <summary> /// Etablish a connection to the <see cref="IQueryRemoteHandler">Remote Service</see>. /// </summary> public void Connect() { if (handler == null) { handler = connectMethod(); } }
/// <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; }
/// <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)); }
/// <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)); }
/// <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; } }
/// <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; }
/// <summary> /// Initializes this class. /// </summary> /// <param name="queryRemoteHandlerInstance"><see cref="IQueryRemoteHandler"/> to communicate with the server.</param> public ClientQueryHandler(IQueryRemoteHandler queryRemoteHandlerInstance) { QueryRemoteHandlerInstance = queryRemoteHandlerInstance; }
/// <summary> /// Initializes this class. /// </summary> protected ServerQueryRemotingHandler() { InnerHandler = GetRegisteredService(); }
/// <summary> /// Initializes this class. /// </summary> protected ServerQueryRemotingHandler() { // ReSharper disable DoNotCallOverridableMethodsInConstructor InnerHandler = GetRegisteredService(); // ReSharper restore DoNotCallOverridableMethodsInConstructor }
/// <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; } }
/// <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; }
/// <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; }