This commit is contained in:
@@ -33,30 +33,30 @@
|
|||||||
* * DYNAMORM_OMMIT_TRYPARSE - Remove TryParse helpers (also applies DYNAMORM_OMMIT_GENERICEXECUTION)
|
* * DYNAMORM_OMMIT_TRYPARSE - Remove TryParse helpers (also applies DYNAMORM_OMMIT_GENERICEXECUTION)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using DynamORM.Builders.Extensions;
|
using System;
|
||||||
using DynamORM.Builders.Implementation;
|
using System.Collections;
|
||||||
using DynamORM.Builders;
|
|
||||||
using DynamORM.Helpers.Dynamics;
|
|
||||||
using DynamORM.Helpers;
|
|
||||||
using DynamORM.Mapper;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Collections;
|
|
||||||
using System.Data.Common;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Data.Common;
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Text;
|
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", "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.")]
|
[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
|
namespace DynamORM
|
||||||
{
|
{
|
||||||
/// <summary>Small utility class to manage single columns.</summary>
|
/// <summary>Small utility class to manage single columns.</summary>
|
||||||
@@ -1841,7 +1841,8 @@ namespace DynamORM
|
|||||||
|
|
||||||
#region Type schema
|
#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...
|
// TODO: Ged rid of this monster below...
|
||||||
if (databaseSchemaSupport)
|
if (databaseSchemaSupport)
|
||||||
@@ -1863,7 +1864,7 @@ namespace DynamORM
|
|||||||
col.HasValue ? col.Value.IsKey : false).Value,
|
col.HasValue ? col.Value.IsKey : false).Value,
|
||||||
Type = DynamicExtensions.CoalesceNullable<DbType>(
|
Type = DynamicExtensions.CoalesceNullable<DbType>(
|
||||||
v.Value.Column != null ? v.Value.Column.Type : null,
|
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<bool>(
|
IsUnique = DynamicExtensions.CoalesceNullable<bool>(
|
||||||
v.Value.Column != null ? v.Value.Column.IsUnique : null,
|
v.Value.Column != null ? v.Value.Column.IsUnique : null,
|
||||||
col.HasValue ? col.Value.IsUnique : false).Value,
|
col.HasValue ? col.Value.IsUnique : false).Value,
|
||||||
@@ -1890,7 +1891,7 @@ namespace DynamORM
|
|||||||
{
|
{
|
||||||
Name = DynamicExtensions.Coalesce<string>(v.Value.Column == null || string.IsNullOrEmpty(v.Value.Column.Name) ? null : v.Value.Column.Name, v.Value.Name),
|
Name = DynamicExtensions.Coalesce<string>(v.Value.Column == null || string.IsNullOrEmpty(v.Value.Column.Name) ? null : v.Value.Column.Name, v.Value.Name),
|
||||||
IsKey = DynamicExtensions.CoalesceNullable<bool>(v.Value.Column != null ? v.Value.Column.IsKey : false, false).Value,
|
IsKey = DynamicExtensions.CoalesceNullable<bool>(v.Value.Column != null ? v.Value.Column.IsKey : false, false).Value,
|
||||||
Type = DynamicExtensions.CoalesceNullable<DbType>(v.Value.Column != null ? v.Value.Column.Type : null, DbType.String).Value,
|
Type = DynamicExtensions.CoalesceNullable<DbType>(v.Value.Column != null ? v.Value.Column.Type : null, DynamicExtensions.TypeMap.TryGetNullable(v.Value.Type) ?? DbType.String).Value,
|
||||||
IsUnique = DynamicExtensions.CoalesceNullable<bool>(v.Value.Column != null ? v.Value.Column.IsUnique : null, false).Value,
|
IsUnique = DynamicExtensions.CoalesceNullable<bool>(v.Value.Column != null ? v.Value.Column.IsUnique : null, false).Value,
|
||||||
Size = DynamicExtensions.CoalesceNullable<int>(v.Value.Column != null ? v.Value.Column.Size : null, 0).Value,
|
Size = DynamicExtensions.CoalesceNullable<int>(v.Value.Column != null ? v.Value.Column.Size : null, 0).Value,
|
||||||
Precision = DynamicExtensions.CoalesceNullable<byte>(v.Value.Column != null ? v.Value.Column.Precision : null, 0).Value,
|
Precision = DynamicExtensions.CoalesceNullable<byte>(v.Value.Column != null ? v.Value.Column.Precision : null, 0).Value,
|
||||||
@@ -4803,7 +4804,6 @@ namespace DynamORM
|
|||||||
IDynamicDeleteQueryBuilder Where(object conditions, bool schema = false);
|
IDynamicDeleteQueryBuilder Where(object conditions, bool schema = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Dynamic insert query builder interface.</summary>
|
/// <summary>Dynamic insert query builder interface.</summary>
|
||||||
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
||||||
public interface IDynamicInsertQueryBuilder : IDynamicQueryBuilder
|
public interface IDynamicInsertQueryBuilder : IDynamicQueryBuilder
|
||||||
@@ -4835,7 +4835,6 @@ namespace DynamORM
|
|||||||
IDynamicInsertQueryBuilder Insert(object o);
|
IDynamicInsertQueryBuilder Insert(object o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Dynamic query builder base interface.</summary>
|
/// <summary>Dynamic query builder base interface.</summary>
|
||||||
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
||||||
public interface IDynamicQueryBuilder
|
public interface IDynamicQueryBuilder
|
||||||
@@ -4876,7 +4875,6 @@ namespace DynamORM
|
|||||||
Action<IParameter, IDbDataParameter> OnCreateParameter { get; set; }
|
Action<IParameter, IDbDataParameter> OnCreateParameter { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Dynamic select query builder interface.</summary>
|
/// <summary>Dynamic select query builder interface.</summary>
|
||||||
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
||||||
public interface IDynamicSelectQueryBuilder : IDynamicQueryBuilder ////, IEnumerable<object>
|
public interface IDynamicSelectQueryBuilder : IDynamicQueryBuilder ////, IEnumerable<object>
|
||||||
@@ -5080,7 +5078,6 @@ namespace DynamORM
|
|||||||
#endregion Top/Limit/Offset/Distinct
|
#endregion Top/Limit/Offset/Distinct
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Dynamic update query builder interface.</summary>
|
/// <summary>Dynamic update query builder interface.</summary>
|
||||||
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
|
||||||
public interface IDynamicUpdateQueryBuilder : IDynamicQueryBuilder
|
public interface IDynamicUpdateQueryBuilder : IDynamicQueryBuilder
|
||||||
@@ -5171,7 +5168,6 @@ namespace DynamORM
|
|||||||
#endregion Where
|
#endregion Where
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Interface describing parameter info.</summary>
|
/// <summary>Interface describing parameter info.</summary>
|
||||||
public interface IParameter
|
public interface IParameter
|
||||||
{
|
{
|
||||||
@@ -5195,7 +5191,6 @@ namespace DynamORM
|
|||||||
DynamicSchemaColumn? Schema { get; set; }
|
DynamicSchemaColumn? Schema { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Interface describing table information.</summary>
|
/// <summary>Interface describing table information.</summary>
|
||||||
public interface ITableInfo
|
public interface ITableInfo
|
||||||
{
|
{
|
||||||
@@ -5212,7 +5207,6 @@ namespace DynamORM
|
|||||||
Dictionary<string, DynamicSchemaColumn> Schema { get; }
|
Dictionary<string, DynamicSchemaColumn> Schema { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace Extensions
|
namespace Extensions
|
||||||
{
|
{
|
||||||
internal static class DynamicModifyBuilderExtensions
|
internal static class DynamicModifyBuilderExtensions
|
||||||
@@ -5336,7 +5330,6 @@ namespace DynamORM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal static class DynamicWhereQueryExtensions
|
internal static class DynamicWhereQueryExtensions
|
||||||
{
|
{
|
||||||
#region Where
|
#region Where
|
||||||
@@ -5529,8 +5522,6 @@ namespace DynamORM
|
|||||||
|
|
||||||
#endregion Where
|
#endregion Where
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Implementation
|
namespace Implementation
|
||||||
@@ -5627,7 +5618,6 @@ namespace DynamORM
|
|||||||
#endregion Where
|
#endregion Where
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Implementation of dynamic insert query builder.</summary>
|
/// <summary>Implementation of dynamic insert query builder.</summary>
|
||||||
internal class DynamicInsertQueryBuilder : DynamicModifyBuilder, IDynamicInsertQueryBuilder
|
internal class DynamicInsertQueryBuilder : DynamicModifyBuilder, IDynamicInsertQueryBuilder
|
||||||
{
|
{
|
||||||
@@ -5800,7 +5790,6 @@ namespace DynamORM
|
|||||||
#endregion Insert
|
#endregion Insert
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Base query builder for insert/update/delete statements.</summary>
|
/// <summary>Base query builder for insert/update/delete statements.</summary>
|
||||||
internal abstract class DynamicModifyBuilder : DynamicQueryBuilder
|
internal abstract class DynamicModifyBuilder : DynamicQueryBuilder
|
||||||
{
|
{
|
||||||
@@ -5840,7 +5829,6 @@ namespace DynamORM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Implementation of dynamic query builder base interface.</summary>
|
/// <summary>Implementation of dynamic query builder base interface.</summary>
|
||||||
internal abstract class DynamicQueryBuilder : IDynamicQueryBuilder
|
internal abstract class DynamicQueryBuilder : IDynamicQueryBuilder
|
||||||
{
|
{
|
||||||
@@ -6589,7 +6577,6 @@ namespace DynamORM
|
|||||||
#endregion Helpers
|
#endregion Helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Implementation of dynamic select query builder.</summary>
|
/// <summary>Implementation of dynamic select query builder.</summary>
|
||||||
internal class DynamicSelectQueryBuilder : DynamicQueryBuilder, IDynamicSelectQueryBuilder, DynamicQueryBuilder.IQueryWithWhere
|
internal class DynamicSelectQueryBuilder : DynamicQueryBuilder, IDynamicSelectQueryBuilder, DynamicQueryBuilder.IQueryWithWhere
|
||||||
{
|
{
|
||||||
@@ -7845,7 +7832,6 @@ namespace DynamORM
|
|||||||
#endregion Helpers
|
#endregion Helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Update query builder.</summary>
|
/// <summary>Update query builder.</summary>
|
||||||
internal class DynamicUpdateQueryBuilder : DynamicModifyBuilder, IDynamicUpdateQueryBuilder, DynamicQueryBuilder.IQueryWithWhere
|
internal class DynamicUpdateQueryBuilder : DynamicModifyBuilder, IDynamicUpdateQueryBuilder, DynamicQueryBuilder.IQueryWithWhere
|
||||||
{
|
{
|
||||||
@@ -8128,10 +8114,7 @@ namespace DynamORM
|
|||||||
|
|
||||||
#endregion Where
|
#endregion Where
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Helpers
|
namespace Helpers
|
||||||
@@ -8229,7 +8212,6 @@ namespace DynamORM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Framework detection and specific implementations.</summary>
|
/// <summary>Framework detection and specific implementations.</summary>
|
||||||
public static class FrameworkTools
|
public static class FrameworkTools
|
||||||
{
|
{
|
||||||
@@ -8350,7 +8332,6 @@ namespace DynamORM
|
|||||||
#endregion GetGenericTypeArguments
|
#endregion GetGenericTypeArguments
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Extends <see cref="IDisposable"/> interface.</summary>
|
/// <summary>Extends <see cref="IDisposable"/> interface.</summary>
|
||||||
public interface IExtendedDisposable : IDisposable
|
public interface IExtendedDisposable : IDisposable
|
||||||
{
|
{
|
||||||
@@ -8363,7 +8344,6 @@ namespace DynamORM
|
|||||||
bool IsDisposed { get; }
|
bool IsDisposed { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Class containing useful string extensions.</summary>
|
/// <summary>Class containing useful string extensions.</summary>
|
||||||
internal static class StringExtensions
|
internal static class StringExtensions
|
||||||
{
|
{
|
||||||
@@ -8661,7 +8641,6 @@ namespace DynamORM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Class contains unclassified extensions.</summary>
|
/// <summary>Class contains unclassified extensions.</summary>
|
||||||
internal static class UnclassifiedExtensions
|
internal static class UnclassifiedExtensions
|
||||||
{
|
{
|
||||||
@@ -8705,7 +8684,6 @@ namespace DynamORM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace Dynamics
|
namespace Dynamics
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -9802,7 +9780,6 @@ namespace DynamORM
|
|||||||
#endregion Implementation of IExtendedDisposable
|
#endregion Implementation of IExtendedDisposable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Class that allows to use interfaces as dynamic objects.</summary>
|
/// <summary>Class that allows to use interfaces as dynamic objects.</summary>
|
||||||
/// <typeparam name="T">Type of class to proxy.</typeparam>
|
/// <typeparam name="T">Type of class to proxy.</typeparam>
|
||||||
/// <remarks>This is temporary solution. Which allows to use builders as a dynamic type.</remarks>
|
/// <remarks>This is temporary solution. Which allows to use builders as a dynamic type.</remarks>
|
||||||
@@ -10034,10 +10011,7 @@ namespace DynamORM
|
|||||||
return arguments.Concat(parameters.Skip(arguments.Length).Select(p => p.DefaultValue)).ToArray();
|
return arguments.Concat(parameters.Skip(arguments.Length).Select(p => p.DefaultValue)).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Mapper
|
namespace Mapper
|
||||||
@@ -10183,7 +10157,6 @@ namespace DynamORM
|
|||||||
#endregion Constructors
|
#endregion Constructors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Class with mapper cache.</summary>
|
/// <summary>Class with mapper cache.</summary>
|
||||||
public static class DynamicMapperCache
|
public static class DynamicMapperCache
|
||||||
{
|
{
|
||||||
@@ -10225,7 +10198,6 @@ namespace DynamORM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Dynamic property invoker.</summary>
|
/// <summary>Dynamic property invoker.</summary>
|
||||||
public class DynamicPropertyInvoker
|
public class DynamicPropertyInvoker
|
||||||
{
|
{
|
||||||
@@ -10320,7 +10292,6 @@ namespace DynamORM
|
|||||||
#endregion Type command cache
|
#endregion Type command cache
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Represents type columnMap.</summary>
|
/// <summary>Represents type columnMap.</summary>
|
||||||
public class DynamicTypeMap
|
public class DynamicTypeMap
|
||||||
{
|
{
|
||||||
@@ -10436,7 +10407,6 @@ namespace DynamORM
|
|||||||
#endregion Type command cache
|
#endregion Type command cache
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Allows to add ignore action to property.</summary>
|
/// <summary>Allows to add ignore action to property.</summary>
|
||||||
/// <remarks>Property still get's mapped from output.</remarks>
|
/// <remarks>Property still get's mapped from output.</remarks>
|
||||||
[AttributeUsage(AttributeTargets.Property)]
|
[AttributeUsage(AttributeTargets.Property)]
|
||||||
@@ -10444,7 +10414,6 @@ namespace DynamORM
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Allows to add table name to class.</summary>
|
/// <summary>Allows to add table name to class.</summary>
|
||||||
[AttributeUsage(AttributeTargets.Class)]
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
public class TableAttribute : Attribute
|
public class TableAttribute : Attribute
|
||||||
@@ -10461,9 +10430,5 @@ namespace DynamORM
|
|||||||
/// set this to true to get schema from type.</remarks>
|
/// set this to true to get schema from type.</remarks>
|
||||||
public bool Override { get; set; }
|
public bool Override { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user