Show / Hide Table of Contents

Class DatabaseObject

Class to represent a database through which the user can connect to and query from.

Inheritance
System.Object
DatabaseObject
OracleDatabase
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: DatabaseConnector
Assembly: DatabaseConnector.dll
Syntax
public abstract class DatabaseObject

Constructors

| Improve this Doc View Source

DatabaseObject()

Initializes a new instance of the DatabaseObject class.

Declaration
public DatabaseObject()
| Improve this Doc View Source

DatabaseObject(ILogger)

Initializes a new instance of the DatabaseObject class.

Declaration
public DatabaseObject(ILogger logger)
Parameters
Type Name Description
Microsoft.Extensions.Logging.ILogger logger

The logger to be used in this library.

| Improve this Doc View Source

DatabaseObject(String)

Initializes a new instance of the DatabaseObject class.

Declaration
public DatabaseObject(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string to be used to connect to the database.

| Improve this Doc View Source

DatabaseObject(String, ILogger)

Initializes a new instance of the DatabaseObject class.

Declaration
public DatabaseObject(string connectionString, ILogger logger)
Parameters
Type Name Description
System.String connectionString

The connection string to be used to connect to the database.

Microsoft.Extensions.Logging.ILogger logger

The logger to be used in this library.

Properties

| Improve this Doc View Source

Connected

Gets or sets a value indicating whether gets or sets the state of the database.

Declaration
protected bool Connected { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ConnectionString

Gets or sets the connection string to connect to the database.

Declaration
protected string ConnectionString { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Logger

Gets or sets the logger to be used by the database.

Declaration
protected ILogger Logger { get; set; }
Property Value
Type Description
Microsoft.Extensions.Logging.ILogger

Methods

| Improve this Doc View Source

Connect()

Connects to the database.

Declaration
public abstract bool Connect()
Returns
Type Description
System.Boolean
true
if the database has been successfully connected to.
| Improve this Doc View Source

Disconnect()

Disconnects from the database.

Declaration
public abstract bool Disconnect()
Returns
Type Description
System.Boolean
true
if the database has been successfully disconnected from.
| Improve this Doc View Source

ExecuteNonQuery(String)

Executes the given query that does not return any data (e.g. update, insert, delete).

Declaration
public abstract bool ExecuteNonQuery(string nonQuery)
Parameters
Type Name Description
System.String nonQuery

Query to execute.

Returns
Type Description
System.Boolean
true
if query was successfully executed.
| Improve this Doc View Source

ExecuteQuery(String)

Executes the given query that retrieves data from the database.

Declaration
public abstract List<List<object>> ExecuteQuery(string query)
Parameters
Type Name Description
System.String query

Query to execute.

Returns
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<System.Object>>

Data queried from the database.

| Improve this Doc View Source

IsConnected()

Returns whether or not a connection has been established to the database.

true
if the database has been connected to

Declaration
public abstract bool IsConnected()
Returns
Type Description
System.Boolean
true
if the database has been connected to.
  • Improve this Doc
  • View Source
Back to top Generated by DocFX