diff --git a/AmalgamationTool/DynamORM.Amalgamation.cs b/AmalgamationTool/DynamORM.Amalgamation.cs
index 24de65b..ec9e88b 100644
--- a/AmalgamationTool/DynamORM.Amalgamation.cs
+++ b/AmalgamationTool/DynamORM.Amalgamation.cs
@@ -33,30 +33,30 @@
* * DYNAMORM_OMMIT_TRYPARSE - Remove TryParse helpers (also applies DYNAMORM_OMMIT_GENERICEXECUTION)
*/
-using DynamORM.Builders.Extensions;
-using DynamORM.Builders.Implementation;
-using DynamORM.Builders;
-using DynamORM.Helpers.Dynamics;
-using DynamORM.Helpers;
-using DynamORM.Mapper;
+using System;
+using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
-using System.Collections;
-using System.Data.Common;
using System.Data;
+using System.Data.Common;
using System.Dynamic;
using System.IO;
-using System.Linq.Expressions;
using System.Linq;
+using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Text;
-using System;
+using DynamORM.Builders;
+using DynamORM.Builders.Extensions;
+using DynamORM.Builders.Implementation;
+using DynamORM.Helpers;
+using DynamORM.Helpers.Dynamics;
+using DynamORM.Mapper;
[module: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "This is a generated file which generates all the necessary support classes.")]
[module: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1403:FileMayOnlyContainASingleNamespace", Justification = "This is a generated file which generates all the necessary support classes.")]
+
namespace DynamORM
{
/// Small utility class to manage single columns.
@@ -1841,7 +1841,8 @@ namespace DynamORM
#region Type schema
- if (mapperSchema && !Schema.ContainsKey(mapper.Type.FullName))
+ if ((mapperSchema && !Schema.ContainsKey(mapper.Type.FullName)) ||
+ (schema == null && mapper != null && !mapper.Type.IsAnonymous()))
{
// TODO: Ged rid of this monster below...
if (databaseSchemaSupport)
@@ -1863,7 +1864,7 @@ namespace DynamORM
col.HasValue ? col.Value.IsKey : false).Value,
Type = DynamicExtensions.CoalesceNullable(
v.Value.Column != null ? v.Value.Column.Type : null,
- col.HasValue ? col.Value.Type : DbType.String).Value,
+ col.HasValue ? col.Value.Type : DynamicExtensions.TypeMap.TryGetNullable(v.Value.Type) ?? DbType.String).Value,
IsUnique = DynamicExtensions.CoalesceNullable(
v.Value.Column != null ? v.Value.Column.IsUnique : null,
col.HasValue ? col.Value.IsUnique : false).Value,
@@ -1890,7 +1891,7 @@ namespace DynamORM
{
Name = DynamicExtensions.Coalesce(v.Value.Column == null || string.IsNullOrEmpty(v.Value.Column.Name) ? null : v.Value.Column.Name, v.Value.Name),
IsKey = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.IsKey : false, false).Value,
- Type = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.Type : null, DbType.String).Value,
+ Type = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.Type : null, DynamicExtensions.TypeMap.TryGetNullable(v.Value.Type) ?? DbType.String).Value,
IsUnique = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.IsUnique : null, false).Value,
Size = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.Size : null, 0).Value,
Precision = DynamicExtensions.CoalesceNullable(v.Value.Column != null ? v.Value.Column.Precision : null, 0).Value,
@@ -4756,7 +4757,7 @@ namespace DynamORM
}
namespace Builders
- {
+ {
/// Dynamic delete query builder interface.
/// This interface it publically available. Implementation should be hidden.
public interface IDynamicDeleteQueryBuilder : IDynamicQueryBuilder
@@ -4764,7 +4765,7 @@ namespace DynamORM
/// Execute this builder.
/// Result of an execution..
int Execute();
-
+
///
/// Adds to the 'Where' clause the contents obtained from parsing the dynamic lambda expression given. The condition
/// is parsed to the appropriate syntax, where the specific customs virtual methods supported by the parser are used
@@ -4776,25 +4777,25 @@ namespace DynamORM
/// The specification.
/// This instance to permit chaining.
IDynamicDeleteQueryBuilder Where(Func func);
-
+
/// Add where condition.
/// Condition column with operator and value.
/// Builder instance.
IDynamicDeleteQueryBuilder Where(DynamicColumn column);
-
+
/// Add where condition.
/// Condition column.
/// Condition operator.
/// Condition value.
/// Builder instance.
IDynamicDeleteQueryBuilder Where(string column, DynamicColumn.CompareOperator op, object value);
-
+
/// Add where condition.
/// Condition column.
/// Condition value.
/// Builder instance.
IDynamicDeleteQueryBuilder Where(string column, object value);
-
+
/// Add where condition.
/// Set conditions as properties and values of an object.
/// If true use schema to determine key columns and ignore those which
@@ -4802,8 +4803,7 @@ namespace DynamORM
/// Builder instance.
IDynamicDeleteQueryBuilder Where(object conditions, bool schema = false);
}
-
-
+
/// Dynamic insert query builder interface.
/// This interface it publically available. Implementation should be hidden.
public interface IDynamicInsertQueryBuilder : IDynamicQueryBuilder
@@ -4811,7 +4811,7 @@ namespace DynamORM
/// Execute this builder.
/// Result of an execution..
int Execute();
-
+
///
/// Specifies the columns to insert using the dynamic lambda expressions given. Each expression correspond to one
/// column, and can:
@@ -4822,61 +4822,59 @@ namespace DynamORM
/// The specifications.
/// This instance to permit chaining.
IDynamicInsertQueryBuilder Values(Func fn, params Func[] func);
-
+
/// Add insert fields.
/// Insert column.
/// Insert value.
/// Builder instance.
IDynamicInsertQueryBuilder Insert(string column, object value);
-
+
/// Add insert fields.
/// Set insert value as properties and values of an object.
/// Builder instance.
IDynamicInsertQueryBuilder Insert(object o);
}
-
-
+
/// Dynamic query builder base interface.
/// This interface it publically available. Implementation should be hidden.
public interface IDynamicQueryBuilder
{
/// Gets instance.
DynamicDatabase Database { get; }
-
+
/// Gets tables information.
IList Tables { get; }
-
+
/// Gets the tables used in this builder.
IDictionary Parameters { get; }
-
+
/// Gets or sets a value indicating whether add virtual parameters.
bool VirtualMode { get; set; }
-
+
/// Gets a value indicating whether database supports standard schema.
bool SupportSchema { get; }
-
+
/// Fill command with query.
/// Command to fill.
/// Filled instance of .
IDbCommand FillCommand(IDbCommand command);
-
+
///
/// Generates the text this command will execute against the underlying database.
///
/// The text to execute against the underlying database.
/// This method must be override by derived classes.
string CommandText();
-
+
/// Gets or sets the on create temporary parameter action.
/// This is exposed to allow setting schema of column.
Action OnCreateTemporaryParameter { get; set; }
-
+
/// Gets or sets the on create real parameter action.
/// This is exposed to allow modification of parameter.
Action OnCreateParameter { get; set; }
}
-
-
+
/// Dynamic select query builder interface.
/// This interface it publically available. Implementation should be hidden.
public interface IDynamicSelectQueryBuilder : IDynamicQueryBuilder ////, IEnumerable