This commit is contained in:
grzegorz.russek
2016-10-19 08:36:38 +00:00
parent d8b6c8f488
commit 22e4534296
5 changed files with 15 additions and 12 deletions

View File

@@ -1374,7 +1374,7 @@ namespace DynamORM
/// <summary>Reads the type of column from the schema.</summary>
/// <param name="schema">The schema.</param>
/// <returns>GEneric parameter type.</returns>
/// <returns>Generic parameter type.</returns>
protected virtual DbType ReadSchemaType(dynamic schema)
{
Type type = (Type)schema.DATATYPE;
@@ -1382,10 +1382,11 @@ namespace DynamORM
// Small hack for SQL Server Provider
if (type == typeof(string) && Provider != null && Provider.GetType() == typeof(System.Data.SqlClient.SqlClientFactory))
{
var map = (schema as IDictionary<string, object>);
var map = schema as IDictionary<string, object>;
string typeName = (map.TryGetValue("DATATYPENAME") ?? string.Empty).ToString();
switch (typeName){
switch (typeName)
{
case "varchar":
return DbType.AnsiString;
case "nvarchar":