Nullable ignored on AllowNull test
This commit is contained in:
@@ -44,6 +44,7 @@ using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Data.Common;
|
||||
using System.Data;
|
||||
using System.Dynamic;
|
||||
@@ -4526,7 +4527,7 @@ namespace DynamORM
|
||||
});
|
||||
|
||||
if (method != null)
|
||||
ret = o.ToString().TryParseDefault<T>(defaultValue, delegate (string v, out T r)
|
||||
ret = o.ToString().TryParseDefault<T>(defaultValue, delegate(string v, out T r)
|
||||
{
|
||||
r = defaultValue;
|
||||
return (bool)method.Invoke(null, new object[] { v, r });
|
||||
@@ -4585,7 +4586,7 @@ namespace DynamORM
|
||||
else if (typeof(T) == typeof(object))
|
||||
ret = (T)o;
|
||||
else if (method != null)
|
||||
ret = o.ToString().TryParseDefault<T>(defaultValue, delegate (string v, out T r)
|
||||
ret = o.ToString().TryParseDefault<T>(defaultValue, delegate(string v, out T r)
|
||||
{
|
||||
r = defaultValue;
|
||||
return (bool)method.Invoke(null, new object[] { v, r });
|
||||
@@ -4646,7 +4647,7 @@ namespace DynamORM
|
||||
param.Scale,
|
||||
param.Precision,
|
||||
param.Scale,
|
||||
param.Value is byte[]? ConvertByteArrayToHexString((byte[])param.Value) : param.Value ?? "NULL",
|
||||
param.Value is byte[] ? ConvertByteArrayToHexString((byte[])param.Value) : param.Value ?? "NULL",
|
||||
param.Value != null ? param.Value.GetType().Name : "DBNull");
|
||||
}
|
||||
|
||||
@@ -7292,7 +7293,7 @@ namespace DynamORM
|
||||
/// <returns>Result of a query.</returns>
|
||||
object Scalar();
|
||||
|
||||
#if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE
|
||||
#if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE
|
||||
|
||||
/// <summary>Returns a single result.</summary>
|
||||
/// <typeparam name="T">Type to parse to.</typeparam>
|
||||
@@ -7300,7 +7301,7 @@ namespace DynamORM
|
||||
/// <returns>Result of a query.</returns>
|
||||
T ScalarAs<T>(T defaultValue = default(T));
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#region From/Join
|
||||
|
||||
@@ -9679,7 +9680,7 @@ namespace DynamORM
|
||||
}
|
||||
}
|
||||
|
||||
#if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE
|
||||
#if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE
|
||||
|
||||
/// <summary>Returns a single result.</summary>
|
||||
/// <typeparam name="T">Type to parse to.</typeparam>
|
||||
@@ -9696,7 +9697,7 @@ namespace DynamORM
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endregion Execution
|
||||
|
||||
@@ -11823,7 +11824,7 @@ namespace DynamORM
|
||||
func(obj) : elseFunc != null ? elseFunc() : default(R);
|
||||
}
|
||||
|
||||
#if !NET6_0_OR_GREATER
|
||||
#if !NET6_0_OR_GREATER
|
||||
/// <summary>Simple distinct by selector extension.</summary>
|
||||
/// <returns>The enumerator of elements distinct by specified selector.</returns>
|
||||
/// <param name="source">Source collection.</param>
|
||||
@@ -11837,7 +11838,7 @@ namespace DynamORM
|
||||
if (seenKeys.Add(keySelector(element)))
|
||||
yield return element;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace Dynamics
|
||||
@@ -13968,7 +13969,7 @@ namespace DynamORM
|
||||
|
||||
Column = attr;
|
||||
|
||||
if (attr != null && attr.AllowNull && Type.IsNullableType())
|
||||
if (attr != null && attr.AllowNull && !Type.IsNullableType())
|
||||
attr.AllowNull = false;
|
||||
|
||||
if (property.CanRead)
|
||||
@@ -15107,7 +15108,8 @@ namespace DynamORM
|
||||
public object Value { get; internal set; }
|
||||
|
||||
/// <summary>Gets the result.</summary>
|
||||
public ValidateResult Result { get; internal set; }
|
||||
public ValidateResult Result { get;internal set;}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace DynamORM.Mapper
|
||||
|
||||
Column = attr;
|
||||
|
||||
if (attr != null && attr.AllowNull && Type.IsNullableType())
|
||||
if (attr != null && attr.AllowNull && !Type.IsNullableType())
|
||||
attr.AllowNull = false;
|
||||
|
||||
if (property.CanRead)
|
||||
|
||||
Reference in New Issue
Block a user