Permalink
Browse files

Added DbConnectionStringBuilder constructor to Massive.Oracle.cs.

  • Loading branch information...
1 parent 2b12f34 commit 1d74c3dbfbfa3eaf40bf22ba54314ea5a69b6b62 @DoggettCK committed Apr 3, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 Massive.Oracle.cs
View
@@ -126,6 +126,18 @@ public static DynamicModel Open(string connectionStringName)
else
ConnectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
}
+ public DynamicModel(DbConnectionStringBuilder connectionStringBuilder, string tableName = "",
+ string primaryKeyField = "", string descriptorField = "", string sequence = "")
+ {
+ TableName = tableName == "" ? this.GetType().Name : tableName;
+ PrimaryKeyField = string.IsNullOrEmpty(primaryKeyField) ? "ID" : primaryKeyField;
+ DescriptorField = descriptorField;
+
+ _sequence = sequence == "" ? ConfigurationManager.AppSettings["default_seq"] : sequence;
+ _factory = DbProviderFactories.GetFactory("System.Data.OracleClient");
+
+ ConnectionString = connectionStringBuilder.ConnectionString;
+ }
/// <summary>
/// Creates a new Expando from a Form POST - white listed against the columns in the DB

0 comments on commit 1d74c3d

Please sign in to comment.