Exemplo n.º 1
0
 // CONSTRUCTORS DESTRUCTOR
 /// <summary>
 /// Basic constructor without parameters.
 /// </summary>
 public DataBaseService()
 {
     driver          = null;
     message         = null;
     dbConfiguration = null;
     rand            = new System.Random();
     disposedValue   = false;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sets database configuration.
 /// </summary>
 /// <param name="configuration">Some configuration for setting up.</param>
 /// <returns>
 /// Current service for data access.
 /// </returns>
 /// <exception cref="System.ArgumentException">
 /// Thrown when the configuration is inappropriate.
 /// </exception>
 public Interfaces.IDataAccessService SetConfiguration(Interfaces.IConfiguration configuration)
 {
     if (!(configuration is DBConfiguration))
     {
         throw new System.ArgumentException("The configuration is inappropriate.");
     }
     dbConfiguration = (DBConfiguration)configuration;
     return(this);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Special disposer.
 /// </summary>
 /// <param name="disposing">Says what resources must be disposed.</param>
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             dbConfiguration.Dispose();
             dbConfiguration = null;
             SetNullToDriverAndMessage();
             rand = null;
         }
         disposedValue = true;
     }
 }