Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added DbConnectionStringBuilder constructor to Massive.PostgreSQL.cs.

  • Loading branch information...
commit 96fe9f0109a82f69a2f813ddb4230adf5e356bac 1 parent 1d74c3d
@DoggettCK authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 Massive.PostgreSQL.cs
View
10 Massive.PostgreSQL.cs
@@ -151,6 +151,16 @@ public static DynamicModel Open(string connectionStringName)
_factory = DbProviderFactories.GetFactory(_providerName);
ConnectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
}
+ public DynamicModel(DbConnectionStringBuilder connectionStringBuilder, string tableName = "",
+ string primaryKeyField = "", string descriptorField = "")
+ {
+ TableName = tableName == "" ? this.GetType().Name : tableName;
+ PrimaryKeyField = string.IsNullOrEmpty(primaryKeyField) ? "ID" : primaryKeyField;
+ DescriptorField = descriptorField;
+
+ _factory = DbProviderFactories.GetFactory("Npgsql");
+ ConnectionString = connectionStringBuilder.ConnectionString;
+ }
/// <summary>
/// Creates a new Expando from a Form POST - white listed against the columns in the DB

0 comments on commit 96fe9f0

Please sign in to comment.
Something went wrong with that request. Please try again.