WebCab Portfolio for .NET v5.0 Demo

ADOMediator.UnderlyingInstance Property

This property holds the instance of a Portfolio class, used in Database computations.

public object UnderlyingInstance {get; set;}

Remarks

Initially, this property is not set, so the next step after constructing an instance of this class is setting this property to an instance of one of the classes in the Portfolio namespace.

Exceptions

Exception TypeCondition
ADOMediatorExceptionThrown when trying to assign an instance of a class which is not part of the WebCab Portfolio namespace.

Example

The following example creates and assigns an instance of the EasyOptimal class to an instance of the ADO Mediator class.

               // Create a new instance of this class.
               EasyOptimal instance = new EasyOptimal ();
               ...
               // Create an instance of the ADO Mediator class
               // (parameters omitted)
               ADOMediator ado = new ADOMediator (...);
               ...
               // Assign the EasyOptimal instance to the ADO Mediator
               ado.UnderlyingInstance = instance;
            
After the assignment has taken place, the ADOMediator will direct all method calls to the EasyOptimal instance. For example, if you wish to invoke a method belonging to the EasyOptimal class, with values taken from the database, using a SELECT statement, you would write something similar to:
               double result = ado.OneSelect ("NameOfMethodInEasyOptimalClass",
                    "SELECT DATE, OPEN, CLOSE FROM IBM");
            
The ado instance of the ADOMediator class will call the NameOfMethodInEasyOptimalClass method on the instance returned by this property.

See Also

ADOMediator Class | WebCab.Libraries.Finance.Portfolio.ADO Namespace