Show / Hide Table of Contents

    OracleDataContextOptions<TAdoDbContext>.OracleDataContextOptions(string connectionString) Constructor

    .NET Standard 2.x

    Initializes a new instance of the OracleDataContextOptions<TAdoDbContext> class by passing the connection string as a parameter.

    Namespace: SnapObjects.Data.Oracle

    Assembly: SnapObjects.Data.Oracle.dll

    Syntax

    public OracleDataContextOptions(string connectionString) : base(connectionString)
    

    Parameters

    connectionString System.String

    A string containing connection information about how to connect to the data source.

    Examples

    The following code example uses a connection string to initialize an instance of the OracleDataContextOptions<OracleContext> class.

    using Appeon.ApiDoc.Models;
    using SnapObjects.Data;
    using SnapObjects.Data.Oracle;
    using System;
    
    namespace Appeon.ApiDoc.OracleDataContextOptions_GenericExamples
    {
        public class OracleDataContextOptions_GenericExample
        {
            public void Example()
            {
                var options = new OracleDataContextOptions<OracleContext>(CONNECTION_STRING);
    
                var dataContext = new OracleDataContext(options);
    
                Console.WriteLine(dataContext.ContextOptions.DatabaseType);
    
                /*This code produces the following output:
    
                Oracle
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon