Ejemplo n.º 1
0
 /// <summary>
 /// Returns a simple SQL Server connection string to the local machine for the given context type
 /// with the specified credentials.
 /// </summary>
 /// <param name="userId"> User ID to be use when connecting to SQL Server. </param>
 /// <param name="password"> Password for the SQL Server account. </param>
 /// <param name="persistSecurityInfo">
 /// Indicates if security-sensitive information is not returned as part of the
 /// connection if the connection has ever been opened.
 /// </param>
 /// <returns> The connection string. </returns>
 public static string SimpleConnectionStringWithCredentials <TContext>(
     string userId,
     string password,
     bool persistSecurityInfo = false)
     where TContext : DbContext
 {
     return(ModelHelpers.SimpleConnectionStringWithCredentials <TContext>(
                userId,
                password,
                persistSecurityInfo));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns a simple SQL Server connection string with the specified credentials.
 /// </summary>
 /// <param name="databaseName"> The database name. </param>
 /// <param name="userId"> User ID to be use when connecting to SQL Server. </param>
 /// <param name="password"> Password for the SQL Server account. </param>
 /// <param name="persistSecurityInfo">
 /// Indicates if security-sensitive information is not returned as part of the
 /// connection if the connection has ever been opened.
 /// </param>
 /// <returns> The connection string. </returns>
 protected static string SimpleConnectionStringWithCredentials(
     string databaseName,
     string userId,
     string password,
     bool persistSecurityInfo = false)
 {
     return(ModelHelpers.SimpleConnectionStringWithCredentials(
                databaseName,
                userId,
                password,
                persistSecurityInfo));
 }