Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed dumb dumb bug with provider name setting

  • Loading branch information...
commit abd7f24f6b03efe146d682ab2ffb291ad5f819e5 1 parent ee4539f
@subsonic subsonic authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 Massive.cs
View
7 Massive.cs
@@ -96,9 +96,12 @@ public class DynamicModel : DynamicObject {
public DynamicModel(string connectionStringName, string tableName = "", string primaryKeyField = "") {
TableName = tableName == "" ? this.GetType().Name : tableName;
PrimaryKeyField = string.IsNullOrEmpty(primaryKeyField) ? "ID" : primaryKeyField;
- var _providerName = "System.Data.SqlClient";
- _factory = DbProviderFactories.GetFactory(_providerName);
_connectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
+ var _providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName;
+ if(String.IsNullOrEmpty(_providerName))
+ _providerName = "System.Data.SqlClient";
+ _factory = DbProviderFactories.GetFactory(_providerName);
+
}
/// <summary>
/// List out all the schema bits for use with ... whatever
Please sign in to comment.
Something went wrong with that request. Please try again.