This commit is contained in:
grzegorz.russek
2016-07-18 06:20:23 +00:00
parent f5b4834fd5
commit 0c55aedbb1
2 changed files with 1128 additions and 1160 deletions

View File

@@ -33,31 +33,31 @@
* * 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.Concurrent;
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
{
/// <summary>Small utility class to manage single columns.</summary>
@@ -5857,7 +5857,6 @@ namespace DynamORM
IDynamicDeleteQueryBuilder Where(object conditions, bool schema = false);
}
/// <summary>Dynamic insert query builder interface.</summary>
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
public interface IDynamicInsertQueryBuilder : IDynamicQueryBuilder
@@ -5889,7 +5888,6 @@ namespace DynamORM
IDynamicInsertQueryBuilder Insert(object o);
}
/// <summary>Dynamic query builder base interface.</summary>
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
public interface IDynamicQueryBuilder : IExtendedDisposable
@@ -5930,7 +5928,6 @@ namespace DynamORM
List<Action<IParameter, IDbDataParameter>> OnCreateParameter { get; set; }
}
/// <summary>Dynamic select query builder interface.</summary>
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
public interface IDynamicSelectQueryBuilder : IDynamicQueryBuilder ////, IEnumerable<object>
@@ -6144,7 +6141,6 @@ namespace DynamORM
#endregion Top/Limit/Offset/Distinct
}
/// <summary>Dynamic update query builder interface.</summary>
/// <remarks>This interface it publically available. Implementation should be hidden.</remarks>
public interface IDynamicUpdateQueryBuilder : IDynamicQueryBuilder
@@ -6235,7 +6231,6 @@ namespace DynamORM
#endregion Where
}
/// <summary>Interface describing parameter info.</summary>
public interface IParameter : IExtendedDisposable
{
@@ -6259,7 +6254,6 @@ namespace DynamORM
DynamicSchemaColumn? Schema { get; set; }
}
/// <summary>Interface describing table information.</summary>
public interface ITableInfo : IExtendedDisposable
{
@@ -6276,7 +6270,6 @@ namespace DynamORM
Dictionary<string, DynamicSchemaColumn> Schema { get; }
}
namespace Extensions
{
internal static class DynamicModifyBuilderExtensions
@@ -6400,7 +6393,6 @@ namespace DynamORM
}
}
internal static class DynamicWhereQueryExtensions
{
#region Where
@@ -6605,8 +6597,6 @@ namespace DynamORM
#endregion Where
}
}
namespace Implementation
@@ -6703,7 +6693,6 @@ namespace DynamORM
#endregion Where
}
/// <summary>Implementation of dynamic insert query builder.</summary>
internal class DynamicInsertQueryBuilder : DynamicModifyBuilder, IDynamicInsertQueryBuilder
{
@@ -6889,7 +6878,6 @@ namespace DynamORM
#endregion IExtendedDisposable
}
/// <summary>Base query builder for insert/update/delete statements.</summary>
internal abstract class DynamicModifyBuilder : DynamicQueryBuilder
{
@@ -6929,7 +6917,6 @@ namespace DynamORM
}
}
/// <summary>Implementation of dynamic query builder base interface.</summary>
internal abstract class DynamicQueryBuilder : IDynamicQueryBuilder
{
@@ -7829,7 +7816,6 @@ namespace DynamORM
#endregion IExtendedDisposable
}
/// <summary>Implementation of dynamic select query builder.</summary>
internal class DynamicSelectQueryBuilder : DynamicQueryBuilder, IDynamicSelectQueryBuilder, DynamicQueryBuilder.IQueryWithWhere
{
@@ -9118,7 +9104,6 @@ namespace DynamORM
#endregion IExtendedDisposable
}
/// <summary>Update query builder.</summary>
internal class DynamicUpdateQueryBuilder : DynamicModifyBuilder, IDynamicUpdateQueryBuilder, DynamicQueryBuilder.IQueryWithWhere
{
@@ -9418,10 +9403,7 @@ namespace DynamORM
#endregion IExtendedDisposable
}
}
}
namespace Helpers
@@ -9519,7 +9501,6 @@ namespace DynamORM
}
}
/// <summary>Framework detection and specific implementations.</summary>
public static class FrameworkTools
{
@@ -9640,7 +9621,6 @@ namespace DynamORM
#endregion GetGenericTypeArguments
}
/// <summary>Extends <see cref="IDisposable"/> interface.</summary>
public interface IExtendedDisposable : IDisposable
{
@@ -9653,7 +9633,6 @@ namespace DynamORM
bool IsDisposed { get; }
}
/// <summary>Extends <see cref="IExtendedDisposable"/> interface.</summary>
public interface IFinalizerDisposable : IExtendedDisposable
{
@@ -9663,7 +9642,6 @@ namespace DynamORM
void Dispose(bool disposing);
}
/// <summary>Class containing useful string extensions.</summary>
internal static class StringExtensions
{
@@ -9961,7 +9939,6 @@ namespace DynamORM
}
}
/// <summary>Class contains unclassified extensions.</summary>
internal static class UnclassifiedExtensions
{
@@ -10019,7 +9996,6 @@ namespace DynamORM
}
}
namespace Dynamics
{
/// <summary>
@@ -11217,7 +11193,6 @@ namespace DynamORM
#endregion Implementation of IExtendedDisposable
}
/// <summary>Class that allows to use interfaces as dynamic objects.</summary>
/// <typeparam name="T">Type of class to proxy.</typeparam>
/// <remarks>This is temporary solution. Which allows to use builders as a dynamic type.</remarks>
@@ -11260,8 +11235,11 @@ namespace DynamORM
{
try
{
// TODO: MAke this work... open instance delegate would be nice
return Delegate.CreateDelegate(Expression.GetDelegateType(v.GetParameters().Select(t => t.ParameterType).Concat(new[] { v.ReflectedType }).ToArray()), _proxy, v.Name);
Type type = v.ReturnType == typeof(void) ?
Expression.GetActionType(v.GetParameters().Select(t => t.ParameterType).ToArray()) :
Expression.GetDelegateType(v.GetParameters().Select(t => t.ParameterType).Concat(new[] { v.ReturnType }).ToArray());
return Delegate.CreateDelegate(type, _proxy, v.Name);
}
catch (ArgumentException)
{
@@ -11510,10 +11488,7 @@ namespace DynamORM
_proxy = default(T);
}
}
}
}
namespace Mapper
@@ -11659,7 +11634,6 @@ namespace DynamORM
#endregion Constructors
}
/// <summary>Type cast helper.</summary>
public static class DynamicCast
{
@@ -11745,7 +11719,6 @@ namespace DynamORM
}
}
/// <summary>Class with mapper cache.</summary>
public static class DynamicMapperCache
{
@@ -11787,7 +11760,6 @@ namespace DynamORM
}
}
/// <summary>Dynamic property invoker.</summary>
public class DynamicPropertyInvoker
{
@@ -11966,7 +11938,6 @@ namespace DynamORM
#endregion Type command cache
}
/// <summary>Represents type columnMap.</summary>
public class DynamicTypeMap
{
@@ -12121,7 +12092,6 @@ namespace DynamORM
#endregion Type command cache
}
/// <summary>Allows to add ignore action to property.</summary>
/// <remarks>Property still get's mapped from output.</remarks>
[AttributeUsage(AttributeTargets.Property)]
@@ -12129,7 +12099,6 @@ namespace DynamORM
{
}
/// <summary>Allows to add table name to class.</summary>
[AttributeUsage(AttributeTargets.Class)]
public class TableAttribute : Attribute
@@ -12146,9 +12115,5 @@ namespace DynamORM
/// set this to true to get schema from type.</remarks>
public bool Override { get; set; }
}
}
}

View File

@@ -78,8 +78,11 @@ namespace DynamORM.Helpers.Dynamics
{
try
{
// TODO: MAke this work... open instance delegate would be nice
return Delegate.CreateDelegate(Expression.GetDelegateType(v.GetParameters().Select(t => t.ParameterType).Concat(new[] { v.ReflectedType }).ToArray()), _proxy, v.Name);
Type type = v.ReturnType == typeof(void) ?
Expression.GetActionType(v.GetParameters().Select(t => t.ParameterType).ToArray()) :
Expression.GetDelegateType(v.GetParameters().Select(t => t.ParameterType).Concat(new[] { v.ReturnType }).ToArray());
return Delegate.CreateDelegate(type, _proxy, v.Name);
}
catch (ArgumentException)
{