Compare commits

15 Commits

71 changed files with 2430 additions and 7237 deletions

1
.gitignore vendored
View File

@@ -5,6 +5,7 @@ project.lock.json
.DS_Store .DS_Store
*.pyc *.pyc
nupkg/ nupkg/
.idea
# Visual Studio Code # Visual Studio Code
.vscode .vscode

View File

@@ -2000,47 +2000,29 @@ namespace DynamORM
return new DynamicSelectQueryBuilder(this).From(fn); return new DynamicSelectQueryBuilder(this).From(fn);
} }
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>()
{
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)));
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary> /// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam> /// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <param name="alias">Table alias.</param> /// <param name="alias">Table alias.</param>
/// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>(string alias)
{
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias));
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <param name="noLock">use no lock.</param> /// <param name="noLock">use no lock.</param>
/// <returns>This instance to permit chaining.</returns> /// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>(bool noLock) public virtual IDynamicSelectQueryBuilder From<T>(string alias = null, bool noLock = false)
{ {
// TODO: Make it more readable and maitainable
if (noLock) if (noLock)
{
if (string.IsNullOrEmpty(alias))
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).NoLock()); return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).NoLock());
else else
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)));
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <param name="alias">Table alias.</param>
/// <param name="noLock">use no lock.</param>
/// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>(string alias, bool noLock)
{
if (noLock)
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias).NoLock()); return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias).NoLock());
}
else
{
if (string.IsNullOrEmpty(alias))
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)));
else else
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias)); return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias));
} }
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary> /// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <param name="t">Type which can be represented in database.</param> /// <param name="t">Type which can be represented in database.</param>
@@ -3675,6 +3657,9 @@ namespace DynamORM
/// <summary>Database support stored procedures (EXEC procedure ...).</summary> /// <summary>Database support stored procedures (EXEC procedure ...).</summary>
SupportStoredProcedures = 0x00000100, SupportStoredProcedures = 0x00000100,
/// <summary>Database support stored procedures results (Return value).</summary>
SupportStoredProceduresResult = 0x00000200,
/// <summary>Database support with no lock syntax.</summary> /// <summary>Database support with no lock syntax.</summary>
SupportNoLock = 0x00001000, SupportNoLock = 0x00001000,
@@ -3875,6 +3860,7 @@ namespace DynamORM
{ typeof(char), DbType.StringFixedLength }, { typeof(char), DbType.StringFixedLength },
{ typeof(Guid), DbType.Guid }, { typeof(Guid), DbType.Guid },
{ typeof(DateTime), DbType.DateTime }, { typeof(DateTime), DbType.DateTime },
{ typeof(TimeSpan), DbType.Time },
{ typeof(DateTimeOffset), DbType.DateTimeOffset }, { typeof(DateTimeOffset), DbType.DateTimeOffset },
{ typeof(byte[]), DbType.Binary }, { typeof(byte[]), DbType.Binary },
{ typeof(byte?), DbType.Byte }, { typeof(byte?), DbType.Byte },
@@ -3892,7 +3878,8 @@ namespace DynamORM
{ typeof(char?), DbType.StringFixedLength }, { typeof(char?), DbType.StringFixedLength },
{ typeof(Guid?), DbType.Guid }, { typeof(Guid?), DbType.Guid },
{ typeof(DateTime?), DbType.DateTime }, { typeof(DateTime?), DbType.DateTime },
{ typeof(DateTimeOffset?), DbType.DateTimeOffset } { typeof(TimeSpan?), DbType.Time },
{ typeof(DateTimeOffset?), DbType.DateTimeOffset },
}; };
#endregion Type column map #endregion Type column map
@@ -4088,9 +4075,9 @@ namespace DynamORM
p.DbType = TypeMap.TryGetNullable(type) ?? DbType.String; p.DbType = TypeMap.TryGetNullable(type) ?? DbType.String;
if (type == typeof(DynamicExpando) || type == typeof(ExpandoObject)) if (type == typeof(DynamicExpando) || type == typeof(ExpandoObject))
p.Value = ((IDictionary<string, object>)item).Values.FirstOrDefault(); p.Value = CorrectValue(p.DbType, ((IDictionary<string, object>)item).Values.FirstOrDefault());
else else
p.Value = item; p.Value = CorrectValue(p.DbType, item);
if (p.DbType == DbType.String) if (p.DbType == DbType.String)
p.Size = item.ToString().Length > 4000 ? -1 : 4000; p.Size = item.ToString().Length > 4000 ? -1 : 4000;
@@ -4130,7 +4117,7 @@ namespace DynamORM
p.Scale = 4; p.Scale = 4;
} }
p.Value = value == null ? DBNull.Value : value; p.Value = CorrectValue(p.DbType, value);
} }
else if (value == null || value == DBNull.Value) else if (value == null || value == DBNull.Value)
p.Value = DBNull.Value; p.Value = DBNull.Value;
@@ -4143,7 +4130,7 @@ namespace DynamORM
else if (p.DbType == DbType.String) else if (p.DbType == DbType.String)
p.Size = value.ToString().Length > 4000 ? -1 : 4000; p.Size = value.ToString().Length > 4000 ? -1 : 4000;
p.Value = value; p.Value = CorrectValue(p.DbType, value);
} }
cmd.Parameters.Add(p); cmd.Parameters.Add(p);
@@ -4151,6 +4138,24 @@ namespace DynamORM
return cmd; return cmd;
} }
private static object CorrectValue(DbType type, object value)
{
if (value == null || value == DBNull.Value)
return DBNull.Value;
if ((type == DbType.String || type == DbType.AnsiString || type == DbType.StringFixedLength || type == DbType.AnsiStringFixedLength) &&
!(value is string))
return value.ToString();
else if (type == DbType.Guid && value is string)
return Guid.Parse(value.ToString());
else if (type == DbType.Guid && value is byte[] && ((byte[])value).Length == 16)
return new Guid((byte[])value);
else if (type == DbType.DateTime && value is TimeSpan) // HACK: This is specific for SQL Server, to be verified with other databases
return DateTime.Today.Add((TimeSpan)value);
return value;
}
/// <summary>Extension for adding single parameter determining only type of object.</summary> /// <summary>Extension for adding single parameter determining only type of object.</summary>
/// <param name="cmd">Command to handle.</param> /// <param name="cmd">Command to handle.</param>
/// <param name="builder">Query builder containing schema.</param> /// <param name="builder">Query builder containing schema.</param>
@@ -4183,7 +4188,7 @@ namespace DynamORM
p.Scale = 4; p.Scale = 4;
} }
p.Value = item.Value == null ? DBNull.Value : item.Value; p.Value = item.Value == null ? DBNull.Value : CorrectValue(p.DbType, item.Value);
} }
else if (item.Value == null || item.Value == DBNull.Value) else if (item.Value == null || item.Value == DBNull.Value)
p.Value = DBNull.Value; p.Value = DBNull.Value;
@@ -4196,7 +4201,7 @@ namespace DynamORM
else if (p.DbType == DbType.String) else if (p.DbType == DbType.String)
p.Size = item.Value.ToString().Length > 4000 ? -1 : 4000; p.Size = item.Value.ToString().Length > 4000 ? -1 : 4000;
p.Value = item.Value; p.Value = CorrectValue(p.DbType, item.Value);
} }
cmd.Parameters.Add(p); cmd.Parameters.Add(p);
@@ -4223,7 +4228,7 @@ namespace DynamORM
param.Size = size; param.Size = size;
param.Precision = precision; param.Precision = precision;
param.Scale = scale; param.Scale = scale;
param.Value = value; param.Value = CorrectValue(param.DbType, value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -4269,7 +4274,7 @@ namespace DynamORM
param.DbType = databaseType; param.DbType = databaseType;
param.Precision = precision; param.Precision = precision;
param.Scale = scale; param.Scale = scale;
param.Value = value; param.Value = CorrectValue(param.DbType, value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -4290,7 +4295,7 @@ namespace DynamORM
param.DbType = databaseType; param.DbType = databaseType;
param.Precision = precision; param.Precision = precision;
param.Scale = scale; param.Scale = scale;
param.Value = value; param.Value = CorrectValue(param.DbType, value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -4330,7 +4335,7 @@ namespace DynamORM
param.Direction = parameterDirection; param.Direction = parameterDirection;
param.DbType = databaseType; param.DbType = databaseType;
param.Size = size; param.Size = size;
param.Value = value ?? DBNull.Value; param.Value = CorrectValue(param.DbType, value ?? DBNull.Value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -4349,7 +4354,7 @@ namespace DynamORM
param.ParameterName = parameterName; param.ParameterName = parameterName;
param.DbType = databaseType; param.DbType = databaseType;
param.Size = size; param.Size = size;
param.Value = value ?? DBNull.Value; param.Value = CorrectValue(param.DbType, value ?? DBNull.Value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -4366,7 +4371,7 @@ namespace DynamORM
IDbDataParameter param = command.CreateParameter(); IDbDataParameter param = command.CreateParameter();
param.ParameterName = parameterName; param.ParameterName = parameterName;
param.DbType = databaseType; param.DbType = databaseType;
param.Value = value ?? DBNull.Value; param.Value = CorrectValue(param.DbType, value ?? DBNull.Value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -4417,7 +4422,8 @@ namespace DynamORM
{ {
try try
{ {
((IDbDataParameter)command.Parameters[parameterName]).Value = value; var p = ((IDbDataParameter)command.Parameters[parameterName]);
p.Value = CorrectValue(p.DbType, value);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -4436,7 +4442,8 @@ namespace DynamORM
{ {
try try
{ {
((IDbDataParameter)command.Parameters[index]).Value = value; var p = ((IDbDataParameter)command.Parameters[index]);
p.Value = CorrectValue(p.DbType, value);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -4523,7 +4530,7 @@ namespace DynamORM
}); });
if (method != null) 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; r = defaultValue;
return (bool)method.Invoke(null, new object[] { v, r }); return (bool)method.Invoke(null, new object[] { v, r });
@@ -4582,7 +4589,7 @@ namespace DynamORM
else if (typeof(T) == typeof(object)) else if (typeof(T) == typeof(object))
ret = (T)o; ret = (T)o;
else if (method != null) 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; r = defaultValue;
return (bool)method.Invoke(null, new object[] { v, r }); return (bool)method.Invoke(null, new object[] { v, r });
@@ -4643,7 +4650,7 @@ namespace DynamORM
param.Scale, param.Scale,
param.Precision, param.Precision,
param.Scale, 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"); param.Value != null ? param.Value.GetType().Name : "DBNull");
} }
@@ -5878,14 +5885,20 @@ namespace DynamORM
else else
{ {
var returnName = _db.GetParameterName("___result___"); var returnName = _db.GetParameterName("___result___");
if ((_db.Options & DynamicDatabaseOptions.SupportStoredProceduresResult) == DynamicDatabaseOptions.SupportStoredProceduresResult)
{
if (!retIsAdded) if (!retIsAdded)
cmd.AddParameter(returnName, ParameterDirection.ReturnValue, DbType.Int32, 4, 0, 0, DBNull.Value); cmd.AddParameter(returnName, ParameterDirection.ReturnValue, DbType.Int32, 4, 0, 0, DBNull.Value);
}
mainResult = cmd.ExecuteNonQuery(); mainResult = cmd.ExecuteNonQuery();
IDbDataParameter returnParam = null; IDbDataParameter returnParam = null;
if (!retIsAdded) if (!retIsAdded)
{
if ((_db.Options & DynamicDatabaseOptions.SupportStoredProceduresResult) == DynamicDatabaseOptions.SupportStoredProceduresResult)
returnParam = cmd.Parameters[returnName] as IDbDataParameter; returnParam = cmd.Parameters[returnName] as IDbDataParameter;
}
else else
{ {
foreach (var e in cmd.Parameters) foreach (var e in cmd.Parameters)
@@ -5989,33 +6002,6 @@ namespace DynamORM
: base(string.Format("{0}{1}{2}", message, Environment.NewLine, command != null ? command.DumpToString() : string.Empty), innerException) : base(string.Format("{0}{1}{2}", message, Environment.NewLine, command != null ? command.DumpToString() : string.Empty), innerException)
{ {
} }
/// <summary>Initializes a new instance of the
/// <see cref="DynamicQueryException"/> class.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" />
/// that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" />
/// that contains contextual information about the source or destination.</param>
public DynamicQueryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>When overridden in a derived class, sets the
/// <see cref="T:System.Runtime.Serialization.SerializationInfo" />
/// with information about the exception.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" />
/// that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" />
/// that contains contextual information about the source or destination.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter" />
/// </PermissionSet>
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
} }
/// <summary>Stores information about column from database schema.</summary> /// <summary>Stores information about column from database schema.</summary>
@@ -7289,7 +7275,7 @@ namespace DynamORM
/// <returns>Result of a query.</returns> /// <returns>Result of a query.</returns>
object Scalar(); object Scalar();
#if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE #if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE
/// <summary>Returns a single result.</summary> /// <summary>Returns a single result.</summary>
/// <typeparam name="T">Type to parse to.</typeparam> /// <typeparam name="T">Type to parse to.</typeparam>
@@ -7297,7 +7283,7 @@ namespace DynamORM
/// <returns>Result of a query.</returns> /// <returns>Result of a query.</returns>
T ScalarAs<T>(T defaultValue = default(T)); T ScalarAs<T>(T defaultValue = default(T));
#endif #endif
#region From/Join #region From/Join
@@ -8441,7 +8427,7 @@ namespace DynamORM
DynamicPropertyInvoker propMap = mapper.ColumnsMap.TryGetValue(colName.ToLower()); DynamicPropertyInvoker propMap = mapper.ColumnsMap.TryGetValue(colName.ToLower());
if (propMap == null || propMap.Column == null || !propMap.Column.IsNoInsert) if (propMap == null || propMap.Column == null || !propMap.Column.IsNoInsert)
Insert(colName, con.Value); Insert(colName, con.Value); // TODO: This probably should get value from mapper
} }
} }
else else
@@ -9676,7 +9662,7 @@ namespace DynamORM
} }
} }
#if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE #if !DYNAMORM_OMMIT_GENERICEXECUTION && !DYNAMORM_OMMIT_TRYPARSE
/// <summary>Returns a single result.</summary> /// <summary>Returns a single result.</summary>
/// <typeparam name="T">Type to parse to.</typeparam> /// <typeparam name="T">Type to parse to.</typeparam>
@@ -9693,7 +9679,7 @@ namespace DynamORM
} }
} }
#endif #endif
#endregion Execution #endregion Execution
@@ -11481,6 +11467,126 @@ namespace DynamORM
void Dispose(bool disposing); void Dispose(bool disposing);
} }
public static class ReaderExtensions
{
public static bool? GetBooleanIfNotNull(this IDataReader r, string name, bool? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetBoolean(ord);
}
public static byte? GetByteIfNotNull(this IDataReader r, string name, byte? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetByte(ord);
}
public static char? GetCharIfNotNull(this IDataReader r, string name, char? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetChar(ord);
}
public static DateTime? GetDateTimeIfNotNull(this IDataReader r, string name, DateTime? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetDateTime(ord);
}
public static decimal? GetDecimalIfNotNull(this IDataReader r, string name, decimal? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetDecimal(ord);
}
public static double? GetDoubleIfNotNull(this IDataReader r, string name, double? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetDouble(ord);
}
public static float? GetFloatIfNotNull(this IDataReader r, string name, float? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetFloat(ord);
}
public static Guid? GetGuidIfNotNull(this IDataReader r, string name, Guid? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetGuid(ord);
}
public static short? GetInt16IfNotNull(this IDataReader r, string name, short? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetInt16(ord);
}
public static int? GetInt32IfNotNull(this IDataReader r, string name, int? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetInt32(ord);
}
public static long? GetInt64IfNotNull(this IDataReader r, string name, long? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetInt64(ord);
}
public static string GetStringIfNotNull(this IDataReader r, string name, string def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetString(ord);
}
public static object GetValueIfNotNull(this IDataReader r, string name, object def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetValue(ord);
}
}
/// <summary>Class containing useful string extensions.</summary> /// <summary>Class containing useful string extensions.</summary>
internal static class StringExtensions internal static class StringExtensions
{ {
@@ -11820,7 +11926,7 @@ namespace DynamORM
func(obj) : elseFunc != null ? elseFunc() : default(R); func(obj) : elseFunc != null ? elseFunc() : default(R);
} }
#if !NET6_0_OR_GREATER #if !NET6_0_OR_GREATER
/// <summary>Simple distinct by selector extension.</summary> /// <summary>Simple distinct by selector extension.</summary>
/// <returns>The enumerator of elements distinct by specified selector.</returns> /// <returns>The enumerator of elements distinct by specified selector.</returns>
/// <param name="source">Source collection.</param> /// <param name="source">Source collection.</param>
@@ -11834,7 +11940,7 @@ namespace DynamORM
if (seenKeys.Add(keySelector(element))) if (seenKeys.Add(keySelector(element)))
yield return element; yield return element;
} }
#endif #endif
} }
namespace Dynamics namespace Dynamics
@@ -13194,7 +13300,7 @@ namespace DynamORM
catch (TargetInvocationException e) catch (TargetInvocationException e)
{ {
if (e.InnerException != null) throw e.InnerException; if (e.InnerException != null) throw e.InnerException;
else throw e; throw;
} }
} }
@@ -13881,13 +13987,6 @@ namespace DynamORM
public DynamicMapperException(string message, Exception innerException) : base(message, innerException) public DynamicMapperException(string message, Exception innerException) : base(message, innerException)
{ {
} }
/// <summary>Initializes a new instance of the <see cref="DynamicMapperException"/> class.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
protected DynamicMapperException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
} }
/// <summary>Dynamic property invoker.</summary> /// <summary>Dynamic property invoker.</summary>
@@ -13965,7 +14064,7 @@ namespace DynamORM
Column = attr; Column = attr;
if (attr != null && attr.AllowNull && Type.IsNullableType()) if (attr != null && attr.AllowNull && !Type.IsNullableType() && Type != typeof(string))
attr.AllowNull = false; attr.AllowNull = false;
if (property.CanRead) if (property.CanRead)
@@ -13977,10 +14076,10 @@ namespace DynamORM
private Func<object, object> CreateGetter(PropertyInfo property) private Func<object, object> CreateGetter(PropertyInfo property)
{ {
if (!property.CanRead) if (property == null || !property.CanRead)
return null; return null;
ParameterExpression objParm = Expression.Parameter(typeof(object), "o"); var objParm = Expression.Parameter(typeof(object), "o");
return Expression.Lambda<Func<object, object>>( return Expression.Lambda<Func<object, object>>(
Expression.Convert( Expression.Convert(
@@ -13995,8 +14094,8 @@ namespace DynamORM
if (!property.CanWrite) if (!property.CanWrite)
return null; return null;
ParameterExpression objParm = Expression.Parameter(typeof(object), "o"); var objParm = Expression.Parameter(typeof(object), "o");
ParameterExpression valueParm = Expression.Parameter(typeof(object), "value"); var valueParm = Expression.Parameter(typeof(object), "value");
return Expression.Lambda<Action<object, object>>( return Expression.Lambda<Action<object, object>>(
Expression.Assign( Expression.Assign(
@@ -14569,7 +14668,7 @@ namespace DynamORM
if (pm.Column != null) if (pm.Column != null)
{ {
if (pm.Column.IsKey) if (pm.Column.IsKey || pm.Column.IsNoUpdate)
continue; continue;
if (!pm.Column.AllowNull && cf.Value == null) if (!pm.Column.AllowNull && cf.Value == null)
@@ -15104,7 +15203,8 @@ namespace DynamORM
public object Value { get; internal set; } public object Value { get; internal set; }
/// <summary>Gets the result.</summary> /// <summary>Gets the result.</summary>
public ValidateResult Result { get; internal set; } public ValidateResult Result { get;internal set;}
} }
} }
} }

View File

@@ -1,91 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DynamORM.Tests</RootNamespace>
<AssemblyName>DynamORM.Tests</AssemblyName>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;MONO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MONO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="nunit.framework">
<Private>False</Private>
<Package>nunit</Package>
</Reference>
<Reference Include="Mono.Data.Sqlite" />
</ItemGroup>
<ItemGroup>
<Compile Include="Helpers\Dynamic\DynamicParserTests.cs" />
<Compile Include="Modify\DynamicModificationTests.cs" />
<Compile Include="Modify\DynamicNoSchemaModificationTests.cs" />
<Compile Include="Modify\DynamicTypeSchemaModificationTests.cs" />
<Compile Include="Modify\ParserTests.cs" />
<Compile Include="Select\DynamicNoSchemaAccessTests.cs" />
<Compile Include="Select\DynamicTypeSchemaAccessTests.cs" />
<Compile Include="Helpers\AttachToDebugger.cs" />
<Compile Include="Select\DynamicAccessTests.cs" />
<Compile Include="Helpers\Users.cs" />
<Compile Include="Helpers\UsersBareBoneClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Select\LegacyParserTests.cs" />
<Compile Include="Select\ParserTests.cs" />
<Compile Include="Select\RenamedTypedAccessTests.cs" />
<Compile Include="TestsBase.cs" />
<Compile Include="Select\TypedAccessTests.cs" />
<Compile Include="Helpers\PoolingTests.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DynamORM\DynamORM.csproj">
<Project>{63963ED7-9C78-4672-A4D4-339B6E825503}</Project>
<Name>DynamORM</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,138 +1,44 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net8.0</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Description>Dynamic Object-Relational Mapping tests library.</Description>
<ProductVersion>8.0.30703</ProductVersion> <Copyright>Copyright © RUSSEK Software 2012-2024</Copyright>
<SchemaVersion>2.0</SchemaVersion> <Company>RUSSEK Software</Company>
<ProjectGuid>{D5013B4E-8A1B-4DBB-8FB5-E09935F4F764}</ProjectGuid> <Authors>Grzegorz Russek</Authors>
<VersionPrefix>1.8</VersionPrefix>
<RepositoryUrl>https://git.dr4cul4.pl/RUSSEK-Software/DynamORM</RepositoryUrl>
<PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
<Product>DynamORM</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <IsPackable>false</IsPackable>
<RootNamespace>DynamORM.Tests</RootNamespace> <ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>DynamORM.Tests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<SignAssembly>False</SignAssembly>
<DelaySign>False</DelaySign>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>Full</DebugType> <ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
<Optimize>False</Optimize> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<BaseAddress>4194304</BaseAddress>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<Prefer32Bit>False</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>PdbOnly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<BaseAddress>4194304</BaseAddress>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<Prefer32Bit>False</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<Prefer32Bit>False</Prefer32Bit>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Helpers\Dynamic\DynamicParserTests.cs" /> <ProjectReference Include="..\DynamORM\DynamORM.csproj" />
<Compile Include="Helpers\PoolingTests.cs" />
<Compile Include="Helpers\Validation\ObjectValidationTest.cs" />
<Compile Include="Modify\DynamicModificationTests.cs" />
<Compile Include="Modify\DynamicNoSchemaModificationTests.cs" />
<Compile Include="Modify\DynamicTypeSchemaModificationTests.cs" />
<Compile Include="Modify\ParserTests.cs" />
<Compile Include="Select\DynamicNoSchemaAccessTests.cs" />
<Compile Include="Select\DynamicTypeSchemaAccessTests.cs" />
<Compile Include="Helpers\AttachToDebugger.cs" />
<Compile Include="Select\DynamicAccessTests.cs" />
<Compile Include="Helpers\Users.cs" />
<Compile Include="Helpers\UsersBareBoneClass.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Select\LegacyParserTests.cs" />
<Compile Include="Select\ParserTests.cs" />
<Compile Include="TestsBase.cs" />
<Compile Include="Select\TypedAccessTests.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx"> <PackageReference Include="coverlet.collector" Version="6.0.0"/>
<Generator>ResXFileCodeGenerator</Generator> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <PackageReference Include="MSTest.TestAdapter" Version="3.1.1"/>
<SubType>Designer</SubType> <PackageReference Include="MSTest.TestFramework" Version="3.1.1"/>
</EmbeddedResource> <PackageReference Include="System.Data.SQLite" Version="1.0.119" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DynamORM\DynamORM.csproj"> <EmbeddedResource Remove="Helpers\**" />
<Project>{63963ED7-9C78-4672-A4D4-339B6E825503}</Project> <EmbeddedResource Remove="Modify\**" />
<Name>DynamORM</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MSTest.TestAdapter"> <None Remove="Helpers\**" />
<Version>3.3.1</Version> <None Remove="Modify\**" />
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>3.3.1</Version>
</PackageReference>
<PackageReference Include="System.Data.SQLite">
<Version>1.0.118</Version>
</PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project> </Project>

View File

@@ -71,11 +71,11 @@ namespace DynamORM.Tests.Modify
var o = GetTestTable().Single(code: "201"); var o = GetTestTable().Single(code: "201");
Assert.AreNotEqual(200, o.id); Assert.AreNotEqual(200, o.id);
Assert.AreEqual("201", o.code.ToString()); Assert.AreEqual("201", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row insertion by dynamic object.</summary> /// <summary>Test row insertion by dynamic object.</summary>
@@ -88,11 +88,11 @@ namespace DynamORM.Tests.Modify
var o = GetTestTable().Single(code: "202"); var o = GetTestTable().Single(code: "202");
Assert.AreNotEqual(200, o.id); Assert.AreNotEqual(200, o.id);
Assert.AreEqual("202", o.code.ToString()); Assert.AreEqual("202", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row insertion by mapped object.</summary> /// <summary>Test row insertion by mapped object.</summary>
@@ -115,11 +115,11 @@ namespace DynamORM.Tests.Modify
var o = u.Single(code: "203"); var o = u.Single(code: "203");
Assert.AreNotEqual(200, o.id); Assert.AreNotEqual(200, o.id);
Assert.AreEqual("203", o.code.ToString()); Assert.AreEqual("203", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row insertion by basic object.</summary> /// <summary>Test row insertion by basic object.</summary>
@@ -142,11 +142,11 @@ namespace DynamORM.Tests.Modify
var o = u.Single(code: "204"); var o = u.Single(code: "204");
Assert.AreNotEqual(200, o.id); Assert.AreNotEqual(200, o.id);
Assert.AreEqual("204", o.code.ToString()); Assert.AreEqual("204", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
#endregion Insert #endregion Insert
@@ -163,11 +163,11 @@ namespace DynamORM.Tests.Modify
var o = GetTestTable().Single(code: "201"); var o = GetTestTable().Single(code: "201");
Assert.AreEqual(1, o.id); Assert.AreEqual(1, o.id);
Assert.AreEqual("201", o.code.ToString()); Assert.AreEqual("201", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row updating by dynamic objects.</summary> /// <summary>Test row updating by dynamic objects.</summary>
@@ -180,11 +180,11 @@ namespace DynamORM.Tests.Modify
var o = GetTestTable().Single(code: "202"); var o = GetTestTable().Single(code: "202");
Assert.AreEqual(2, o.id); Assert.AreEqual(2, o.id);
Assert.AreEqual("202", o.code.ToString()); Assert.AreEqual("202", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row updating by mapped object.</summary> /// <summary>Test row updating by mapped object.</summary>
@@ -207,11 +207,11 @@ namespace DynamORM.Tests.Modify
var o = u.Single(code: "203"); var o = u.Single(code: "203");
Assert.AreEqual(3, o.id); Assert.AreEqual(3, o.id);
Assert.AreEqual("203", o.code.ToString()); Assert.AreEqual("203", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row updating by basic object.</summary> /// <summary>Test row updating by basic object.</summary>
@@ -234,11 +234,11 @@ namespace DynamORM.Tests.Modify
var o = u.Single(code: "204"); var o = u.Single(code: "204");
Assert.AreEqual(4, o.id); Assert.AreEqual(4, o.id);
Assert.AreEqual("204", o.code.ToString()); Assert.AreEqual("204", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row updating by dynamic objects.</summary> /// <summary>Test row updating by dynamic objects.</summary>
@@ -251,11 +251,11 @@ namespace DynamORM.Tests.Modify
var o = GetTestTable().Single(code: "205"); var o = GetTestTable().Single(code: "205");
Assert.AreEqual(5, o.id); Assert.AreEqual(5, o.id);
Assert.AreEqual("205", o.code.ToString()); Assert.AreEqual("205", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row updating by mapped objects.</summary> /// <summary>Test row updating by mapped objects.</summary>
@@ -278,11 +278,11 @@ namespace DynamORM.Tests.Modify
var o = u.Single(code: "206"); var o = u.Single(code: "206");
Assert.AreEqual(6, o.id); Assert.AreEqual(6, o.id);
Assert.AreEqual("206", o.code.ToString()); Assert.AreEqual("206", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
/// <summary>Test row updating by basic objects.</summary> /// <summary>Test row updating by basic objects.</summary>
@@ -305,11 +305,11 @@ namespace DynamORM.Tests.Modify
var o = u.Single(code: "207"); var o = u.Single(code: "207");
Assert.AreEqual(7, o.id); Assert.AreEqual(7, o.id);
Assert.AreEqual("207", o.code.ToString()); Assert.AreEqual("207", o.code.ToString());
Assert.AreEqual(null, o.first); Assert.IsNull(o.first);
Assert.AreEqual("Gagarin", o.last); Assert.AreEqual("Gagarin", o.last);
Assert.AreEqual("juri.gagarin@megacorp.com", o.email); Assert.AreEqual("juri.gagarin@megacorp.com", o.email);
Assert.AreEqual("bla, bla, bla", o.quote); Assert.AreEqual("bla, bla, bla", o.quote);
Assert.AreEqual(null, o.password); Assert.IsNull(o.password);
} }
#endregion Update #endregion Update

View File

@@ -32,6 +32,8 @@ using DynamORM.Builders.Implementation;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using DynamORM.Tests.Helpers; using DynamORM.Tests.Helpers;
using System.Collections.Generic; using System.Collections.Generic;
using static System.Data.Entity.Infrastructure.Design.Executor;
using System.Runtime.InteropServices;
namespace DynamORM.Tests.Modify namespace DynamORM.Tests.Modify
{ {
@@ -135,7 +137,7 @@ namespace DynamORM.Tests.Modify
/// Tests the basic update. /// Tests the basic update.
/// </summary> /// </summary>
[TestMethod] [TestMethod]
public void TestUpdateBasic() public void TestUpdateBasicSet()
{ {
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users"); IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
@@ -146,6 +148,24 @@ namespace DynamORM.Tests.Modify
cmd.Parameters.Keys.ToArray()[0], cmd.Parameters.Keys.ToArray()[1], cmd.Parameters.Keys.ToArray()[2], cmd.Parameters.Keys.ToArray()[3]), cmd.CommandText()); cmd.Parameters.Keys.ToArray()[0], cmd.Parameters.Keys.ToArray()[1], cmd.Parameters.Keys.ToArray()[2], cmd.Parameters.Keys.ToArray()[3]), cmd.CommandText());
} }
/// <summary>
/// Tests the basic update.
/// </summary>
[TestMethod]
public void TestUpdateBasicValues()
{
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
cmd
.Values("Code", "001")
.Values("Name", "Admin")
.Values("IsAdmin", "1")
.Where(x => x.Users.Id_User == 1);
Assert.AreEqual(string.Format(@"UPDATE ""Users"" SET ""Code"" = [${0}], ""Name"" = [${1}], ""IsAdmin"" = [${2}] WHERE (""Users"".""Id_User"" = [${3}])",
cmd.Parameters.Keys.ToArray()[0], cmd.Parameters.Keys.ToArray()[1], cmd.Parameters.Keys.ToArray()[2], cmd.Parameters.Keys.ToArray()[3]), cmd.CommandText());
}
/// <summary> /// <summary>
/// Tests the insert with sub query. /// Tests the insert with sub query.
/// </summary> /// </summary>
@@ -153,7 +173,6 @@ namespace DynamORM.Tests.Modify
public void TestUpdateSubQuery() public void TestUpdateSubQuery()
{ {
IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users"); IDynamicUpdateQueryBuilder cmd = new DynamicUpdateQueryBuilder(Database, "Users");
cmd.Set(x => x.Users.Code = "001", x => x.Users.Name = "Admin", x => x.Users.IsAdmin = x(cmd cmd.Set(x => x.Users.Code = "001", x => x.Users.Name = "Admin", x => x.Users.IsAdmin = x(cmd
.SubQuery(a => a.AccessRights.As(a.a)) .SubQuery(a => a.AccessRights.As(a.a))
.Select(a => a.IsAdmin) .Select(a => a.IsAdmin)

View File

@@ -1,65 +0,0 @@
/*
* DynamORM - Dynamic Object-Relational Mapping library.
* Copyright (c) 2012-2015, Grzegorz Russek (grzegorz.russek@gmail.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* See: http://opensource.org/licenses/bsd-license.php
*/
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DynamORM.Tests")]
[assembly: AssemblyDescription("Dynamic Object-Relational Mapping tests library.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("RUSSEK Software")]
[assembly: AssemblyProduct("DynamORM")]
[assembly: AssemblyCopyright("Copyright © RUSSEK Software 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1d8b751b-b3ec-481d-9f7f-14d6e6eb0fde")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.1")]
[assembly: AssemblyFileVersion("1.1.0.1")]

View File

@@ -29,16 +29,16 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using DynamORM.Tests.Helpers; using DynamORM.Tests.Helpers;
using NUnit.Framework; using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace DynamORM.Tests.Select namespace DynamORM.Tests.Select
{ {
/// <summary>Test typed ORM.</summary> /// <summary>Test typed ORM.</summary>
[TestFixture] [TestClass]
public class RenamedTypedAccessTests : TypedAccessTests<Users> public class RenamedTypedAccessTests : TypedAccessTests<Users>
{ {
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary> /// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
[Test] [TestMethod]
public override void TestTypedFancyAggregateQuery() public override void TestTypedFancyAggregateQuery()
{ {
var v = (GetTestTable().Query(type: typeof(Users), columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList(); var v = (GetTestTable().Query(type: typeof(Users), columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
@@ -53,7 +53,7 @@ namespace DynamORM.Tests.Select
} }
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary> /// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
[Test] [TestMethod]
public override void TestGenericFancyAggregateQuery() public override void TestGenericFancyAggregateQuery()
{ {
var v = (GetTestTable().Query<Users>(columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList(); var v = (GetTestTable().Query<Users>(columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
@@ -68,21 +68,21 @@ namespace DynamORM.Tests.Select
} }
/// <summary>Test typed <c>First</c> method.</summary> /// <summary>Test typed <c>First</c> method.</summary>
[Test] [TestMethod]
public override void TestTypedFirst() public override void TestTypedFirst()
{ {
Assert.AreEqual(1, GetTestTable().First(type: typeof(Users), columns: "id").Id); Assert.AreEqual(1, GetTestTable().First(type: typeof(Users), columns: "id").Id);
} }
/// <summary>Test typed <c>Last</c> method.</summary> /// <summary>Test typed <c>Last</c> method.</summary>
[Test] [TestMethod]
public override void TestTypedLast() public override void TestTypedLast()
{ {
Assert.AreEqual(200, GetTestTable().Last(type: typeof(Users), columns: "id").Id); Assert.AreEqual(200, GetTestTable().Last(type: typeof(Users), columns: "id").Id);
} }
/// <summary>Test typed <c>Single</c> multi.</summary> /// <summary>Test typed <c>Single</c> multi.</summary>
[Test] [TestMethod]
public override void TestTypedSingleObject() public override void TestTypedSingleObject()
{ {
var exp = new { id = 19, first = "Ori", last = "Ellis" }; var exp = new { id = 19, first = "Ori", last = "Ellis" };
@@ -94,35 +94,35 @@ namespace DynamORM.Tests.Select
} }
/// <summary>Test typed where expression equal.</summary> /// <summary>Test typed where expression equal.</summary>
[Test] [TestMethod]
public override void TestTypedWhereEq() public override void TestTypedWhereEq()
{ {
Assert.AreEqual("hoyt.tran", GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("id").Eq(100)).Login); Assert.AreEqual("hoyt.tran", GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("id").Eq(100)).Login);
} }
/// <summary>Test typed where expression like.</summary> /// <summary>Test typed where expression like.</summary>
[Test] [TestMethod]
public override void TestTypedWhereLike() public override void TestTypedWhereLike()
{ {
Assert.AreEqual(100, GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("login").Like("Hoyt.%")).Id); Assert.AreEqual(100, GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("login").Like("Hoyt.%")).Id);
} }
/// <summary>Test generic <c>First</c> method.</summary> /// <summary>Test generic <c>First</c> method.</summary>
[Test] [TestMethod]
public override void TestGenericFirst() public override void TestGenericFirst()
{ {
Assert.AreEqual(1, GetTestTable().First<Users>(columns: "id").Id); Assert.AreEqual(1, GetTestTable().First<Users>(columns: "id").Id);
} }
/// <summary>Test generic <c>Last</c> method.</summary> /// <summary>Test generic <c>Last</c> method.</summary>
[Test] [TestMethod]
public override void TestGenericLast() public override void TestGenericLast()
{ {
Assert.AreEqual(200, GetTestTable().Last<Users>(columns: "id").Id); Assert.AreEqual(200, GetTestTable().Last<Users>(columns: "id").Id);
} }
/// <summary>Test generic <c>Single</c> multi.</summary> /// <summary>Test generic <c>Single</c> multi.</summary>
[Test] [TestMethod]
public override void TestGenericSingleObject() public override void TestGenericSingleObject()
{ {
var exp = new { id = 19, first = "Ori", last = "Ellis" }; var exp = new { id = 19, first = "Ori", last = "Ellis" };
@@ -134,14 +134,14 @@ namespace DynamORM.Tests.Select
} }
/// <summary>Test generic where expression equal.</summary> /// <summary>Test generic where expression equal.</summary>
[Test] [TestMethod]
public override void TestGenericWhereEq() public override void TestGenericWhereEq()
{ {
Assert.AreEqual("hoyt.tran", GetTestTable().Single<Users>(where: new DynamicColumn("id").Eq(100)).Login); Assert.AreEqual("hoyt.tran", GetTestTable().Single<Users>(where: new DynamicColumn("id").Eq(100)).Login);
} }
/// <summary>Test generic where expression like.</summary> /// <summary>Test generic where expression like.</summary>
[Test] [TestMethod]
public override void TestGenericWhereLike() public override void TestGenericWhereLike()
{ {
Assert.AreEqual(100, GetTestTable().Single<Users>(where: new DynamicColumn("login").Like("Hoyt.%")).Id); Assert.AreEqual(100, GetTestTable().Single<Users>(where: new DynamicColumn("login").Like("Hoyt.%")).Id);

View File

@@ -127,7 +127,7 @@ namespace DynamORM.Tests.Select
Assert.AreEqual(200, GetTestBuilder() Assert.AreEqual(200, GetTestBuilder()
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Select(x => x.Count(x.t.id)) .Select(x => x.Count(x.t.id))
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test count with in statement.</summary> /// <summary>Test count with in statement.</summary>
@@ -149,7 +149,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.last.In(new object[] { "Hendricks", "Goodwin", "Freeman" }.Take(3))) .Where(x => x.last.In(new object[] { "Hendricks", "Goodwin", "Freeman" }.Take(3)))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test count with in statement.</summary> /// <summary>Test count with in statement.</summary>
@@ -171,7 +171,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.last.In(new object[] { "Hendricks", "Goodwin", "Freeman" })) .Where(x => x.last.In(new object[] { "Hendricks", "Goodwin", "Freeman" }))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed <c>First</c> method.</summary> /// <summary>Test typed <c>First</c> method.</summary>
@@ -231,7 +231,7 @@ namespace DynamORM.Tests.Select
Assert.AreEqual(1, GetTestBuilder() Assert.AreEqual(1, GetTestBuilder()
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Select(x => x.Min(x.t.id)) .Select(x => x.Min(x.t.id))
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed <c>Min</c> method.</summary> /// <summary>Test typed <c>Min</c> method.</summary>
@@ -248,7 +248,7 @@ namespace DynamORM.Tests.Select
Assert.AreEqual(200, GetTestBuilder() Assert.AreEqual(200, GetTestBuilder()
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Select(x => x.Max(x.t.id)) .Select(x => x.Max(x.t.id))
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed <c>Min</c> method.</summary> /// <summary>Test typed <c>Min</c> method.</summary>
@@ -282,7 +282,7 @@ namespace DynamORM.Tests.Select
Assert.AreEqual(20100, GetTestBuilder() Assert.AreEqual(20100, GetTestBuilder()
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Select(x => x.Sum(x.t.id)) .Select(x => x.Sum(x.t.id))
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed <c>Scalar</c> method for invalid operation exception.</summary> /// <summary>Test typed <c>Scalar</c> method for invalid operation exception.</summary>
@@ -516,7 +516,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id != 100) .Where(x => x.t.id != 100)
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression like.</summary> /// <summary>Test typed where expression like.</summary>
@@ -550,7 +550,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.login.NotLike("Hoyt.%")) .Where(x => x.t.login.NotLike("Hoyt.%"))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression not like.</summary> /// <summary>Test typed where expression not like.</summary>
@@ -561,7 +561,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => !x.t.login.Like("Hoyt.%")) .Where(x => !x.t.login.Like("Hoyt.%"))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression greater.</summary> /// <summary>Test typed where expression greater.</summary>
@@ -579,7 +579,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id > 100) .Where(x => x.t.id > 100)
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression greater or equal.</summary> /// <summary>Test typed where expression greater or equal.</summary>
@@ -597,7 +597,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id >= 100) .Where(x => x.t.id >= 100)
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression less.</summary> /// <summary>Test typed where expression less.</summary>
@@ -615,7 +615,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id < 100) .Where(x => x.t.id < 100)
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression less or equal.</summary> /// <summary>Test typed where expression less or equal.</summary>
@@ -633,7 +633,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id <= 100) .Where(x => x.t.id <= 100)
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression between.</summary> /// <summary>Test typed where expression between.</summary>
@@ -651,7 +651,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id.Between(75, 100)) .Where(x => x.t.id.Between(75, 100))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression in parameters.</summary> /// <summary>Test typed where expression in parameters.</summary>
@@ -676,7 +676,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id.In(75, 99, 100)) .Where(x => x.t.id.In(75, 99, 100))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
/// <summary>Test typed where expression in array.</summary> /// <summary>Test typed where expression in array.</summary>
@@ -687,7 +687,7 @@ namespace DynamORM.Tests.Select
.From(x => x(typeof(T)).As(x.t)) .From(x => x(typeof(T)).As(x.t))
.Where(x => x.t.id.In(new[] { 75, 99, 100 })) .Where(x => x.t.id.In(new[] { 75, 99, 100 }))
.Select(x => x.Count()) .Select(x => x.Count())
.Scalar()); .ScalarAs<int>());
} }
#endregion Where typed #endregion Where typed

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -1,196 +0,0 @@
{
"format": 1,
"restore": {
"D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj": {}
},
"projects": {
"D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj",
"projectName": "DynamORM.Tests",
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj",
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\obj\\",
"projectStyle": "PackageReference",
"skipContentFileWrite": true,
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net48"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net48": {
"projectReferences": {
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj"
}
}
}
}
},
"frameworks": {
"net48": {
"dependencies": {
"MSTest.TestAdapter": {
"target": "Package",
"version": "[2.0.0-beta4, )"
},
"MSTest.TestFramework": {
"target": "Package",
"version": "[2.0.0-beta4, )"
},
"System.Data.SQLite": {
"target": "Package",
"version": "[1.0.111, )"
}
}
}
},
"runtimes": {
"win": {
"#import": []
},
"win-x64": {
"#import": []
},
"win-x86": {
"#import": []
}
}
},
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
"version": "1.3.0",
"restore": {
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"projectName": "DynamORM",
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net472",
"net6.0",
"netstandard2.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
},
"net472": {
"targetAlias": "net472",
"projectReferences": {}
},
"netstandard2.0": {
"targetAlias": "netstandard2.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
},
"net472": {
"targetAlias": "net472",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
},
"netstandard2.0": {
"targetAlias": "netstandard2.0",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"NETStandard.Library": {
"suppressParent": "All",
"target": "Package",
"version": "[2.0.3, )",
"autoReferenced": true
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\gruss\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\gruss\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.props" Condition="Exists('$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgEntityFramework Condition=" '$(PkgEntityFramework)' == '' ">C:\Users\gruss\.nuget\packages\entityframework\6.2.0</PkgEntityFramework>
<PkgSystem_Data_SQLite_EF6 Condition=" '$(PkgSystem_Data_SQLite_EF6)' == '' ">C:\Users\gruss\.nuget\packages\system.data.sqlite.ef6\1.0.111</PkgSystem_Data_SQLite_EF6>
</PropertyGroup>
</Project>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)system.data.sqlite.core\1.0.111\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('$(NuGetPackageRoot)system.data.sqlite.core\1.0.111\build\net46\System.Data.SQLite.Core.targets')" />
<Import Project="$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.targets" Condition="Exists('$(NuGetPackageRoot)mstest.testadapter\2.0.0-beta4\build\net45\MSTest.TestAdapter.targets')" />
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
{
"version": 2,
"dgSpecHash": "rAFgnQ0ruwj6gTzn4dYezodFcNf5+kCOxLq8HTYaz7PuF0I0Uc4bTWz4d/BjGTmeTByLE/ZMDAWkH2yJJcIImQ==",
"success": true,
"projectFilePath": "D:\\Source\\.NET\\DynamORM\\DynamORM.Tests\\DynamORM.Tests.csproj",
"expectedPackageFiles": [
"C:\\Users\\gruss\\.nuget\\packages\\entityframework\\6.2.0\\entityframework.6.2.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\mstest.testadapter\\2.0.0-beta4\\mstest.testadapter.2.0.0-beta4.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\mstest.testframework\\2.0.0-beta4\\mstest.testframework.2.0.0-beta4.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.common\\4.3.0\\system.data.common.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite\\1.0.111\\system.data.sqlite.1.0.111.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite.core\\1.0.111\\system.data.sqlite.core.1.0.111.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite.ef6\\1.0.111\\system.data.sqlite.ef6.1.0.111.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlite.linq\\1.0.111\\system.data.sqlite.linq.1.0.111.nupkg.sha512"
],
"logs": []
}

View File

@@ -196,7 +196,7 @@ namespace DynamORM.Builders.Implementation
DynamicPropertyInvoker propMap = mapper.ColumnsMap.TryGetValue(colName.ToLower()); DynamicPropertyInvoker propMap = mapper.ColumnsMap.TryGetValue(colName.ToLower());
if (propMap == null || propMap.Column == null || !propMap.Column.IsNoInsert) if (propMap == null || propMap.Column == null || !propMap.Column.IsNoInsert)
Insert(colName, con.Value); Insert(colName, con.Value); // TODO: This probably should get value from mapper
} }
} }
else else

View File

@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net472;net6.0;net7.0;net8.0</TargetFrameworks> <TargetFrameworks>netstandard2.0;net472;net6.0;net8.0;net10.0</TargetFrameworks>
<Description>Dynamic Object-Relational Mapping library.</Description> <Description>Dynamic Object-Relational Mapping library.</Description>
<Copyright>Copyright © RUSSEK Software 2012-2023</Copyright> <Copyright>Copyright © RUSSEK Software 2012-2024</Copyright>
<Company>RUSSEK Software</Company> <Company>RUSSEK Software</Company>
<Authors>Grzegorz Russek</Authors> <Authors>Grzegorz Russek</Authors>
<VersionPrefix>1.5</VersionPrefix> <VersionPrefix>1.9</VersionPrefix>
<RepositoryUrl>https://git.dr4cul4.pl/RUSSEK-Software/DynamORM</RepositoryUrl> <RepositoryUrl>https://git.dr4cul4.pl/RUSSEK-Software/DynamORM</RepositoryUrl>
<PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl> <PackageProjectUrl>https://dr4cul4.pl</PackageProjectUrl>
<Product>DynamORM</Product> <Product>DynamORM</Product>
@@ -25,5 +25,4 @@
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'"> <ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" /> <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -448,47 +448,29 @@ namespace DynamORM
return new DynamicSelectQueryBuilder(this).From(fn); return new DynamicSelectQueryBuilder(this).From(fn);
} }
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>()
{
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)));
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary> /// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam> /// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <param name="alias">Table alias.</param> /// <param name="alias">Table alias.</param>
/// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>(string alias)
{
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias));
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <param name="noLock">use no lock.</param> /// <param name="noLock">use no lock.</param>
/// <returns>This instance to permit chaining.</returns> /// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>(bool noLock) public virtual IDynamicSelectQueryBuilder From<T>(string alias = null, bool noLock = false)
{ {
// TODO: Make it more readable and maitainable
if (noLock) if (noLock)
{
if (string.IsNullOrEmpty(alias))
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).NoLock()); return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).NoLock());
else else
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)));
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <typeparam name="T">Type which can be represented in database.</typeparam>
/// <param name="alias">Table alias.</param>
/// <param name="noLock">use no lock.</param>
/// <returns>This instance to permit chaining.</returns>
public virtual IDynamicSelectQueryBuilder From<T>(string alias, bool noLock)
{
if (noLock)
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias).NoLock()); return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias).NoLock());
}
else
{
if (string.IsNullOrEmpty(alias))
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)));
else else
return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias)); return new DynamicSelectQueryBuilder(this).From(x => x(typeof(T)).As(alias));
} }
}
/// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary> /// <summary>Adds to the <code>FROM</code> clause using <see cref="Type"/>.</summary>
/// <param name="t">Type which can be represented in database.</param> /// <param name="t">Type which can be represented in database.</param>

View File

@@ -59,6 +59,9 @@ namespace DynamORM
/// <summary>Database support stored procedures (EXEC procedure ...).</summary> /// <summary>Database support stored procedures (EXEC procedure ...).</summary>
SupportStoredProcedures = 0x00000100, SupportStoredProcedures = 0x00000100,
/// <summary>Database support stored procedures results (Return value).</summary>
SupportStoredProceduresResult = 0x00000200,
/// <summary>Database support with no lock syntax.</summary> /// <summary>Database support with no lock syntax.</summary>
SupportNoLock = 0x00001000, SupportNoLock = 0x00001000,

View File

@@ -67,6 +67,7 @@ namespace DynamORM
{ typeof(char), DbType.StringFixedLength }, { typeof(char), DbType.StringFixedLength },
{ typeof(Guid), DbType.Guid }, { typeof(Guid), DbType.Guid },
{ typeof(DateTime), DbType.DateTime }, { typeof(DateTime), DbType.DateTime },
{ typeof(TimeSpan), DbType.Time },
{ typeof(DateTimeOffset), DbType.DateTimeOffset }, { typeof(DateTimeOffset), DbType.DateTimeOffset },
{ typeof(byte[]), DbType.Binary }, { typeof(byte[]), DbType.Binary },
{ typeof(byte?), DbType.Byte }, { typeof(byte?), DbType.Byte },
@@ -84,7 +85,8 @@ namespace DynamORM
{ typeof(char?), DbType.StringFixedLength }, { typeof(char?), DbType.StringFixedLength },
{ typeof(Guid?), DbType.Guid }, { typeof(Guid?), DbType.Guid },
{ typeof(DateTime?), DbType.DateTime }, { typeof(DateTime?), DbType.DateTime },
{ typeof(DateTimeOffset?), DbType.DateTimeOffset } { typeof(TimeSpan?), DbType.Time },
{ typeof(DateTimeOffset?), DbType.DateTimeOffset },
}; };
#endregion Type column map #endregion Type column map
@@ -280,9 +282,9 @@ namespace DynamORM
p.DbType = TypeMap.TryGetNullable(type) ?? DbType.String; p.DbType = TypeMap.TryGetNullable(type) ?? DbType.String;
if (type == typeof(DynamicExpando) || type == typeof(ExpandoObject)) if (type == typeof(DynamicExpando) || type == typeof(ExpandoObject))
p.Value = ((IDictionary<string, object>)item).Values.FirstOrDefault(); p.Value = CorrectValue(p.DbType, ((IDictionary<string, object>)item).Values.FirstOrDefault());
else else
p.Value = item; p.Value = CorrectValue(p.DbType, item);
if (p.DbType == DbType.String) if (p.DbType == DbType.String)
p.Size = item.ToString().Length > 4000 ? -1 : 4000; p.Size = item.ToString().Length > 4000 ? -1 : 4000;
@@ -322,7 +324,7 @@ namespace DynamORM
p.Scale = 4; p.Scale = 4;
} }
p.Value = value == null ? DBNull.Value : value; p.Value = CorrectValue(p.DbType, value);
} }
else if (value == null || value == DBNull.Value) else if (value == null || value == DBNull.Value)
p.Value = DBNull.Value; p.Value = DBNull.Value;
@@ -335,7 +337,7 @@ namespace DynamORM
else if (p.DbType == DbType.String) else if (p.DbType == DbType.String)
p.Size = value.ToString().Length > 4000 ? -1 : 4000; p.Size = value.ToString().Length > 4000 ? -1 : 4000;
p.Value = value; p.Value = CorrectValue(p.DbType, value);
} }
cmd.Parameters.Add(p); cmd.Parameters.Add(p);
@@ -343,6 +345,24 @@ namespace DynamORM
return cmd; return cmd;
} }
private static object CorrectValue(DbType type, object value)
{
if (value == null || value == DBNull.Value)
return DBNull.Value;
if ((type == DbType.String || type == DbType.AnsiString || type == DbType.StringFixedLength || type == DbType.AnsiStringFixedLength) &&
!(value is string))
return value.ToString();
else if (type == DbType.Guid && value is string)
return Guid.Parse(value.ToString());
else if (type == DbType.Guid && value is byte[] && ((byte[])value).Length == 16)
return new Guid((byte[])value);
else if (type == DbType.DateTime && value is TimeSpan) // HACK: This is specific for SQL Server, to be verified with other databases
return DateTime.Today.Add((TimeSpan)value);
return value;
}
/// <summary>Extension for adding single parameter determining only type of object.</summary> /// <summary>Extension for adding single parameter determining only type of object.</summary>
/// <param name="cmd">Command to handle.</param> /// <param name="cmd">Command to handle.</param>
/// <param name="builder">Query builder containing schema.</param> /// <param name="builder">Query builder containing schema.</param>
@@ -375,7 +395,7 @@ namespace DynamORM
p.Scale = 4; p.Scale = 4;
} }
p.Value = item.Value == null ? DBNull.Value : item.Value; p.Value = item.Value == null ? DBNull.Value : CorrectValue(p.DbType, item.Value);
} }
else if (item.Value == null || item.Value == DBNull.Value) else if (item.Value == null || item.Value == DBNull.Value)
p.Value = DBNull.Value; p.Value = DBNull.Value;
@@ -388,7 +408,7 @@ namespace DynamORM
else if (p.DbType == DbType.String) else if (p.DbType == DbType.String)
p.Size = item.Value.ToString().Length > 4000 ? -1 : 4000; p.Size = item.Value.ToString().Length > 4000 ? -1 : 4000;
p.Value = item.Value; p.Value = CorrectValue(p.DbType, item.Value);
} }
cmd.Parameters.Add(p); cmd.Parameters.Add(p);
@@ -415,7 +435,7 @@ namespace DynamORM
param.Size = size; param.Size = size;
param.Precision = precision; param.Precision = precision;
param.Scale = scale; param.Scale = scale;
param.Value = value; param.Value = CorrectValue(param.DbType, value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -461,7 +481,7 @@ namespace DynamORM
param.DbType = databaseType; param.DbType = databaseType;
param.Precision = precision; param.Precision = precision;
param.Scale = scale; param.Scale = scale;
param.Value = value; param.Value = CorrectValue(param.DbType, value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -482,7 +502,7 @@ namespace DynamORM
param.DbType = databaseType; param.DbType = databaseType;
param.Precision = precision; param.Precision = precision;
param.Scale = scale; param.Scale = scale;
param.Value = value; param.Value = CorrectValue(param.DbType, value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -522,7 +542,7 @@ namespace DynamORM
param.Direction = parameterDirection; param.Direction = parameterDirection;
param.DbType = databaseType; param.DbType = databaseType;
param.Size = size; param.Size = size;
param.Value = value ?? DBNull.Value; param.Value = CorrectValue(param.DbType, value ?? DBNull.Value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -541,7 +561,7 @@ namespace DynamORM
param.ParameterName = parameterName; param.ParameterName = parameterName;
param.DbType = databaseType; param.DbType = databaseType;
param.Size = size; param.Size = size;
param.Value = value ?? DBNull.Value; param.Value = CorrectValue(param.DbType, value ?? DBNull.Value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -558,7 +578,7 @@ namespace DynamORM
IDbDataParameter param = command.CreateParameter(); IDbDataParameter param = command.CreateParameter();
param.ParameterName = parameterName; param.ParameterName = parameterName;
param.DbType = databaseType; param.DbType = databaseType;
param.Value = value ?? DBNull.Value; param.Value = CorrectValue(param.DbType, value ?? DBNull.Value);
command.Parameters.Add(param); command.Parameters.Add(param);
return command; return command;
@@ -609,7 +629,8 @@ namespace DynamORM
{ {
try try
{ {
((IDbDataParameter)command.Parameters[parameterName]).Value = value; var p = ((IDbDataParameter)command.Parameters[parameterName]);
p.Value = CorrectValue(p.DbType, value);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -628,7 +649,8 @@ namespace DynamORM
{ {
try try
{ {
((IDbDataParameter)command.Parameters[index]).Value = value; var p = ((IDbDataParameter)command.Parameters[index]);
p.Value = CorrectValue(p.DbType, value);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -380,14 +380,20 @@ namespace DynamORM
else else
{ {
var returnName = _db.GetParameterName("___result___"); var returnName = _db.GetParameterName("___result___");
if ((_db.Options & DynamicDatabaseOptions.SupportStoredProceduresResult) == DynamicDatabaseOptions.SupportStoredProceduresResult)
{
if (!retIsAdded) if (!retIsAdded)
cmd.AddParameter(returnName, ParameterDirection.ReturnValue, DbType.Int32, 4, 0, 0, DBNull.Value); cmd.AddParameter(returnName, ParameterDirection.ReturnValue, DbType.Int32, 4, 0, 0, DBNull.Value);
}
mainResult = cmd.ExecuteNonQuery(); mainResult = cmd.ExecuteNonQuery();
IDbDataParameter returnParam = null; IDbDataParameter returnParam = null;
if (!retIsAdded) if (!retIsAdded)
{
if ((_db.Options & DynamicDatabaseOptions.SupportStoredProceduresResult) == DynamicDatabaseOptions.SupportStoredProceduresResult)
returnParam = cmd.Parameters[returnName] as IDbDataParameter; returnParam = cmd.Parameters[returnName] as IDbDataParameter;
}
else else
{ {
foreach (var e in cmd.Parameters) foreach (var e in cmd.Parameters)

View File

@@ -71,32 +71,5 @@ namespace DynamORM
: base(string.Format("{0}{1}{2}", message, Environment.NewLine, command != null ? command.DumpToString() : string.Empty), innerException) : base(string.Format("{0}{1}{2}", message, Environment.NewLine, command != null ? command.DumpToString() : string.Empty), innerException)
{ {
} }
/// <summary>Initializes a new instance of the
/// <see cref="DynamicQueryException"/> class.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" />
/// that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" />
/// that contains contextual information about the source or destination.</param>
public DynamicQueryException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
/// <summary>When overridden in a derived class, sets the
/// <see cref="T:System.Runtime.Serialization.SerializationInfo" />
/// with information about the exception.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" />
/// that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" />
/// that contains contextual information about the source or destination.</param>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*" />
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter" />
/// </PermissionSet>
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
} }
} }

View File

@@ -1395,7 +1395,7 @@ namespace DynamORM.Helpers.Dynamics
catch (TargetInvocationException e) catch (TargetInvocationException e)
{ {
if (e.InnerException != null) throw e.InnerException; if (e.InnerException != null) throw e.InnerException;
else throw e; throw;
} }
} }

View File

@@ -0,0 +1,125 @@
using System;
using System.Data;
namespace DynamORM.Helpers
{
public static class ReaderExtensions
{
public static bool? GetBooleanIfNotNull(this IDataReader r, string name, bool? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetBoolean(ord);
}
public static byte? GetByteIfNotNull(this IDataReader r, string name, byte? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetByte(ord);
}
public static char? GetCharIfNotNull(this IDataReader r, string name, char? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetChar(ord);
}
public static DateTime? GetDateTimeIfNotNull(this IDataReader r, string name, DateTime? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetDateTime(ord);
}
public static decimal? GetDecimalIfNotNull(this IDataReader r, string name, decimal? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetDecimal(ord);
}
public static double? GetDoubleIfNotNull(this IDataReader r, string name, double? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetDouble(ord);
}
public static float? GetFloatIfNotNull(this IDataReader r, string name, float? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetFloat(ord);
}
public static Guid? GetGuidIfNotNull(this IDataReader r, string name, Guid? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetGuid(ord);
}
public static short? GetInt16IfNotNull(this IDataReader r, string name, short? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetInt16(ord);
}
public static int? GetInt32IfNotNull(this IDataReader r, string name, int? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetInt32(ord);
}
public static long? GetInt64IfNotNull(this IDataReader r, string name, long? def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetInt64(ord);
}
public static string GetStringIfNotNull(this IDataReader r, string name, string def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetString(ord);
}
public static object GetValueIfNotNull(this IDataReader r, string name, object def = null)
{
var ord = r.GetOrdinal(name);
if (r.IsDBNull(ord))
return def;
return r.GetValue(ord);
}
}
}

View File

@@ -24,12 +24,5 @@ namespace DynamORM.Mapper
public DynamicMapperException(string message, Exception innerException) : base(message, innerException) public DynamicMapperException(string message, Exception innerException) : base(message, innerException)
{ {
} }
/// <summary>Initializes a new instance of the <see cref="DynamicMapperException"/> class.</summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
protected DynamicMapperException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
} }
} }

View File

@@ -111,7 +111,7 @@ namespace DynamORM.Mapper
Column = attr; Column = attr;
if (attr != null && attr.AllowNull && Type.IsNullableType()) if (attr != null && attr.AllowNull && !Type.IsNullableType() && Type != typeof(string))
attr.AllowNull = false; attr.AllowNull = false;
if (property.CanRead) if (property.CanRead)
@@ -123,10 +123,10 @@ namespace DynamORM.Mapper
private Func<object, object> CreateGetter(PropertyInfo property) private Func<object, object> CreateGetter(PropertyInfo property)
{ {
if (!property.CanRead) if (property == null || !property.CanRead)
return null; return null;
ParameterExpression objParm = Expression.Parameter(typeof(object), "o"); var objParm = Expression.Parameter(typeof(object), "o");
return Expression.Lambda<Func<object, object>>( return Expression.Lambda<Func<object, object>>(
Expression.Convert( Expression.Convert(
@@ -141,8 +141,8 @@ namespace DynamORM.Mapper
if (!property.CanWrite) if (!property.CanWrite)
return null; return null;
ParameterExpression objParm = Expression.Parameter(typeof(object), "o"); var objParm = Expression.Parameter(typeof(object), "o");
ParameterExpression valueParm = Expression.Parameter(typeof(object), "value"); var valueParm = Expression.Parameter(typeof(object), "value");
return Expression.Lambda<Action<object, object>>( return Expression.Lambda<Action<object, object>>(
Expression.Assign( Expression.Assign(

View File

@@ -141,7 +141,7 @@ namespace DynamORM.Objects
if (pm.Column != null) if (pm.Column != null)
{ {
if (pm.Column.IsKey) if (pm.Column.IsKey || pm.Column.IsNoUpdate)
continue; continue;
if (!pm.Column.AllowNull && cf.Value == null) if (!pm.Column.AllowNull && cf.Value == null)

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -1 +0,0 @@
fc853c749cf501759ad6a0d5531aafc846ac0fde

View File

@@ -1,3 +0,0 @@
is_global = true
build_property.RootNamespace = DynamORM
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]

View File

@@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -1 +0,0 @@
fc853c749cf501759ad6a0d5531aafc846ac0fde

View File

@@ -1,10 +0,0 @@
is_global = true
build_property.TargetFramework = net5.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = DynamORM
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]

View File

@@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -1 +0,0 @@
fc853c749cf501759ad6a0d5531aafc846ac0fde

View File

@@ -1,10 +0,0 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = DynamORM
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]

View File

@@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2023")]
[assembly: System.Reflection.AssemblyDescriptionAttribute("Dynamic Object-Relational Mapping library.")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.3.0")]
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyTitleAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.3.0.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://git.dr4cul4.pl/RUSSEK-Software/DynamORM")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -1 +0,0 @@
fc853c749cf501759ad6a0d5531aafc846ac0fde

View File

@@ -1,3 +0,0 @@
is_global = true
build_property.RootNamespace = DynamORM
build_property.ProjectDir = D:\Source\.NET\DynamORM\DynamORM\

View File

@@ -1,131 +0,0 @@
{
"format": 1,
"restore": {
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {}
},
"projects": {
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
"version": "1.3.0",
"restore": {
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"projectName": "DynamORM",
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net472",
"net6.0",
"netstandard2.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
},
"net472": {
"targetAlias": "net472",
"projectReferences": {}
},
"netstandard2.0": {
"targetAlias": "netstandard2.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
},
"net472": {
"targetAlias": "net472",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
},
"netstandard2.0": {
"targetAlias": "netstandard2.0",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"NETStandard.Library": {
"suppressParent": "All",
"target": "Package",
"version": "[2.0.3, )",
"autoReferenced": true
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\gruss\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\gruss\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
{
"version": 2,
"dgSpecHash": "IuYP4tdqCfN1hgy879V5KHbsnBQClfQ9vldxowC+IrPfJ7aGphHYKMfCNAuH/rZVylrlcnncc6biySxBiZHxXA==",
"success": true,
"projectFilePath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"expectedPackageFiles": [
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.0\\microsoft.netcore.platforms.1.1.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\netstandard.library\\2.0.3\\netstandard.library.2.0.3.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.common\\4.3.0\\system.data.common.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.text.regularexpressions\\4.3.0\\system.text.regularexpressions.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.threading\\4.3.0\\system.threading.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512"
],
"logs": []
}

View File

@@ -4,6 +4,8 @@ using System.Data;
using System.Linq; using System.Linq;
using DynamORM; using DynamORM;
using DynamORM.Helpers; using DynamORM.Helpers;
using DynamORM.Mapper;
using Tester.RealTests;
namespace Tester namespace Tester
{ {
@@ -12,7 +14,8 @@ namespace Tester
private static DynamicDatabase GetORM() private static DynamicDatabase GetORM()
{ {
return new DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance, return new DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance,
"packet size=4096;User Id=sa;Password=;data source=192.168.22.;initial catalog=PLAYGROUND;", //"packet size=4096;User Id=sa;Password=sWe7PepR;data source=192.168.22.10;initial catalog=PLAYGROUND;",
"packet size=4096;User Id=sa;Password=sWe7PepR;data source=192.168.22.10;initial catalog=MOM_DEMO_WMS_FILLED;",
DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema | DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema |
DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands); DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands);
@@ -25,9 +28,58 @@ namespace Tester
private static void Main(string[] args) private static void Main(string[] args)
{ {
//var c = new System.Data.SqlClient.SqlConnection("packet size=4096;User Id=sa;Password=sa123;data source=192.168.0.6;initial catalog=DynamORM;");
using (var db = GetORM()) using (var db = GetORM())
{
//ProcedureHell(db);
OddNullabeleProblem.Test(db);
TableFun(db);
}
}
private static void TableFun(DynamicDatabase db)
{
try
{
db.Execute("DROP TABLE Experiments ");
}
catch { }
db.Execute(@"CREATE TABLE Experiments (
id int NOT NULL PRIMARY KEY,
t1 nvarchar(50) NOT NULL DEFAULT N'',
t2 varchar(50) NOT NULL DEFAULT '',
dd date,
tt time);");
db.Insert<Ex>().Insert(new Ex
{
id = 1,
t1 = "T1",
t2 = "T1",
dd = DateTime.Now,
tt = TimeSpan.FromDays(2) + TimeSpan.FromHours(10),
}).Execute();
var tt = db.From<Ex>().Where(x => x.id == 1).ToList<Ex>().FirstOrDefault();
db.Update<Ex>().Where(x => x.id == 1).Set(x => x.tt = TimeSpan.FromMinutes(10), x => x.dd = DateTime.Now.AddDays(2)).Execute();
db.Execute("DROP TABLE Experiments ");
}
[Table(Name = "Experiments")]
private class Ex
{
public int id { get; set; }
public string t1 { get; set; }
public string t2 { get; set; }
public DateTime dd { get; set; }
public TimeSpan tt { get; set; }
}
private static void ProcedureHell(DynamicDatabase db)
{ {
db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_Scalar AS SELECT 42;"); db.Execute(@"CREATE OR ALTER PROCEDURE sp_Exp_Scalar AS SELECT 42;");
var res0 = db.Procedures.sp_Exp_Scalar(); var res0 = db.Procedures.sp_Exp_Scalar();
@@ -80,41 +132,6 @@ RETURN 42;");
{ {
Size = 256, Size = 256,
}, ret_Return: 0); }, ret_Return: 0);
//try
//{
// db.Execute("DROP TABLE Experiments ");
//}
//catch { }
//db.Execute("CREATE TABLE Experiments (t1 nvarchar(50) NOT NULL DEFAULT N'', t2 varchar(50) NOT NULL DEFAULT '');");
//var q = db.From(x => x.Experiments.As(x.e1));
//q
// .Where(x => x.t2 = "Dupa")
// .Where(x => x.Exists(
// q.SubQuery()
// .From(y => y.Experiments.As(x.e2))
// .Where(y => y.e2.t1 == y.e1.t1)))
// .Execute().ToList();
//db.Execute("DROP TABLE Experiments ");
//IDataReader rdr = db.Procedures.sp_getdate<IDataReader>();
//var dt = rdr.ToDataTable();
//var dt2 = db.Procedures.sp_getdate<DataTable>();
//db.Procedures.usp_API_Generate_Doc_Number<string>(key: Guid.NewGuid(), mdn_id: "ZZ");
//var resL = (db.Procedures.GetProductDesc<IList<GetProductDesc_Result>>() as IEnumerable<dynamic>)
// .Cast<GetProductDesc_Result>()
// .ToArray();
//var res = db.Procedures.GetProductDesc_withparameters<GetProductDesc_Result>(PID: 707);
//res = db.Procedures.GetProductDesc_withDefaultparameters<GetProductDesc_Result>();
//int id = -1;
//var resD = db.Procedures.ins_NewEmp_with_outputparamaters(Ename: "Test2", out_EId: id);
}
} }
private class sp_Exp_SomeData_Result private class sp_Exp_SomeData_Result

View File

@@ -0,0 +1,448 @@
using DynamORM;
using DynamORM.Mapper;
using DynamORM.Objects;
using System;
using System.Collections.Generic;
using System.Text;
namespace Tester.RealTests
{
internal static class OddNullabeleProblem
{
public static void Test(DynamicDatabase db)
{
var ca = new mom_Contractors_Articles();
ca.mca_min_date_valid_out = 5;
ca.mca_mar_code = "342";
ca.mca_mar_name = "234";
ca.SetDynamicEntityState(DynamicEntityState.Existing);
ca.mca_min_date_valid_out = null;
ca.mca_mar_code = null;
ca.mca_mar_name = null;
var r = new DynamicRepositoryBase<mom_Contractors_Articles>(db);
r.Save(ca);
}
[Table(Name = "mom_Contractors_Articles")]
public class mom_Contractors_Articles : DynamicEntityBase
{
private System.Guid _mca_id;
[Column("mca_id", true, AllowNull = false)]
public virtual System.Guid mca_id
{
get { return _mca_id; }
set
{
if (_mca_id != value)
{
this.OnPropertyChanging("mca_id", _mca_id, value);
_mca_id = value;
}
}
}
private System.Nullable<System.Guid> _mca_mc_id;
[Column("mca_mc_id")]
public virtual System.Nullable<System.Guid> mca_mc_id
{
get { return _mca_mc_id; }
set
{
if (_mca_mc_id != value)
{
this.OnPropertyChanging("mca_mc_id", _mca_mc_id, value);
_mca_mc_id = value;
}
}
}
private System.Nullable<System.Guid> _mca_mar_id;
[Column("mca_mar_id")]
public virtual System.Nullable<System.Guid> mca_mar_id
{
get { return _mca_mar_id; }
set
{
if (_mca_mar_id != value)
{
this.OnPropertyChanging("mca_mar_id", _mca_mar_id, value);
_mca_mar_id = value;
}
}
}
private System.Nullable<System.Int32> _mca_min_date_valid_out;
[Column("mca_min_date_valid_out", AllowNull = true)]
public virtual System.Nullable<System.Int32> mca_min_date_valid_out
{
get { return _mca_min_date_valid_out; }
set
{
if (_mca_min_date_valid_out != value)
{
this.OnPropertyChanging("mca_min_date_valid_out", _mca_min_date_valid_out, value);
_mca_min_date_valid_out = value;
}
}
}
private System.Nullable<System.Int32> _mca_min_date_valid_in;
[Column("mca_min_date_valid_in")]
public virtual System.Nullable<System.Int32> mca_min_date_valid_in
{
get { return _mca_min_date_valid_in; }
set
{
if (_mca_min_date_valid_in != value)
{
this.OnPropertyChanging("mca_min_date_valid_in", _mca_min_date_valid_in, value);
_mca_min_date_valid_in = value;
}
}
}
private System.String _mca_mar_code;
[Column("mca_mar_code", AllowNull = true)]
public virtual System.String mca_mar_code
{
get { return _mca_mar_code; }
set
{
if (_mca_mar_code != value)
{
this.OnPropertyChanging("mca_mar_code", _mca_mar_code, value);
_mca_mar_code = value;
}
}
}
private System.String _mca_mar_name;
[Column("mca_mar_name", AllowNull = true)]
public virtual System.String mca_mar_name
{
get { return _mca_mar_name; }
set
{
if (_mca_mar_name != value)
{
this.OnPropertyChanging("mca_mar_name", _mca_mar_name, value);
_mca_mar_name = value;
}
}
}
private System.String _mca_gid;
[Column("mca_GID")]
public virtual System.String mca_GID
{
get { return _mca_gid; }
set
{
if (_mca_gid != value)
{
this.OnPropertyChanging("mca_GID", _mca_gid, value);
_mca_gid = value;
}
}
}
private System.Nullable<System.Decimal> _mca_percent_wz;
[Column("mca_percent_WZ")]
public virtual System.Nullable<System.Decimal> mca_percent_WZ
{
get { return _mca_percent_wz; }
set
{
if (_mca_percent_wz != value)
{
this.OnPropertyChanging("mca_percent_WZ", _mca_percent_wz, value);
_mca_percent_wz = value;
}
}
}
private System.Nullable<System.Decimal> _mca_percent_pz;
[Column("mca_percent_PZ")]
public virtual System.Nullable<System.Decimal> mca_percent_PZ
{
get { return _mca_percent_pz; }
set
{
if (_mca_percent_pz != value)
{
this.OnPropertyChanging("mca_percent_PZ", _mca_percent_pz, value);
_mca_percent_pz = value;
}
}
}
private System.Byte _mca_tss_ignore;
[Column("mca_tss_ignore", AllowNull = false)]
public virtual System.Byte mca_tss_ignore
{
get { return _mca_tss_ignore; }
set
{
if (_mca_tss_ignore != value)
{
this.OnPropertyChanging("mca_tss_ignore", _mca_tss_ignore, value);
_mca_tss_ignore = value;
}
}
}
private System.String _mca_mar_bar_code;
[Column("mca_mar_bar_code")]
public virtual System.String mca_mar_bar_code
{
get { return _mca_mar_bar_code; }
set
{
if (_mca_mar_bar_code != value)
{
this.OnPropertyChanging("mca_mar_bar_code", _mca_mar_bar_code, value);
_mca_mar_bar_code = value;
}
}
}
private System.Nullable<System.Guid> _mca_mus_id_modified;
[Column("mca_mus_id_modified")]
public virtual System.Nullable<System.Guid> mca_mus_id_modified
{
get { return _mca_mus_id_modified; }
set
{
if (_mca_mus_id_modified != value)
{
this.OnPropertyChanging("mca_mus_id_modified", _mca_mus_id_modified, value);
_mca_mus_id_modified = value;
}
}
}
private System.Nullable<System.DateTime> _mca_date_modified;
[Column("mca_date_modified")]
public virtual System.Nullable<System.DateTime> mca_date_modified
{
get { return _mca_date_modified; }
set
{
if (_mca_date_modified != value)
{
this.OnPropertyChanging("mca_date_modified", _mca_date_modified, value);
_mca_date_modified = value;
}
}
}
private System.String _mca_ean_label_unit;
[Column("mca_ean_label_unit")]
public virtual System.String mca_ean_label_unit
{
get { return _mca_ean_label_unit; }
set
{
if (_mca_ean_label_unit != value)
{
this.OnPropertyChanging("mca_ean_label_unit", _mca_ean_label_unit, value);
_mca_ean_label_unit = value;
}
}
}
private System.String _mca_ean_label_pckg;
[Column("mca_ean_label_pckg")]
public virtual System.String mca_ean_label_pckg
{
get { return _mca_ean_label_pckg; }
set
{
if (_mca_ean_label_pckg != value)
{
this.OnPropertyChanging("mca_ean_label_pckg", _mca_ean_label_pckg, value);
_mca_ean_label_pckg = value;
}
}
}
private System.Nullable<System.Decimal> _mca_price;
[Column("mca_price")]
public virtual System.Nullable<System.Decimal> mca_price
{
get { return _mca_price; }
set
{
if (_mca_price != value)
{
this.OnPropertyChanging("mca_price", _mca_price, value);
_mca_price = value;
}
}
}
private System.String _mca_currency_code;
[Column("mca_currency_code")]
public virtual System.String mca_currency_code
{
get { return _mca_currency_code; }
set
{
if (_mca_currency_code != value)
{
this.OnPropertyChanging("mca_currency_code", _mca_currency_code, value);
_mca_currency_code = value;
}
}
}
private System.Nullable<System.Int32> _mca_time_ahead;
[Column("mca_time_ahead")]
public virtual System.Nullable<System.Int32> mca_time_ahead
{
get { return _mca_time_ahead; }
set
{
if (_mca_time_ahead != value)
{
this.OnPropertyChanging("mca_time_ahead", _mca_time_ahead, value);
_mca_time_ahead = value;
}
}
}
private System.Nullable<System.Decimal> _mca_last_price;
[Column("mca_last_price")]
public virtual System.Nullable<System.Decimal> mca_last_price
{
get { return _mca_last_price; }
set
{
if (_mca_last_price != value)
{
this.OnPropertyChanging("mca_last_price", _mca_last_price, value);
_mca_last_price = value;
}
}
}
private System.Nullable<System.Decimal> _mca_logistic_minimum_value;
[Column("mca_logistic_minimum_value")]
public virtual System.Nullable<System.Decimal> mca_logistic_minimum_value
{
get { return _mca_logistic_minimum_value; }
set
{
if (_mca_logistic_minimum_value != value)
{
this.OnPropertyChanging("mca_logistic_minimum_value", _mca_logistic_minimum_value, value);
_mca_logistic_minimum_value = value;
}
}
}
private System.Nullable<System.Decimal> _mca_logistic_minimum_mplt;
[Column("mca_logistic_minimum_mplt")]
public virtual System.Nullable<System.Decimal> mca_logistic_minimum_mplt
{
get { return _mca_logistic_minimum_mplt; }
set
{
if (_mca_logistic_minimum_mplt != value)
{
this.OnPropertyChanging("mca_logistic_minimum_mplt", _mca_logistic_minimum_mplt, value);
_mca_logistic_minimum_mplt = value;
}
}
}
private System.Nullable<System.Decimal> _mca_logistic_minimum_qty;
[Column("mca_logistic_minimum_qty")]
public virtual System.Nullable<System.Decimal> mca_logistic_minimum_qty
{
get { return _mca_logistic_minimum_qty; }
set
{
if (_mca_logistic_minimum_qty != value)
{
this.OnPropertyChanging("mca_logistic_minimum_qty", _mca_logistic_minimum_qty, value);
_mca_logistic_minimum_qty = value;
}
}
}
private System.Nullable<System.Decimal> _mca_req_kj_percent;
[Column("mca_req_kj_percent")]
public virtual System.Nullable<System.Decimal> mca_req_kj_percent
{
get { return _mca_req_kj_percent; }
set
{
if (_mca_req_kj_percent != value)
{
this.OnPropertyChanging("mca_req_kj_percent", _mca_req_kj_percent, value);
_mca_req_kj_percent = value;
}
}
}
private System.Nullable<System.Decimal> _mca_min_order_qty;
[Column("mca_min_order_qty")]
public virtual System.Nullable<System.Decimal> mca_min_order_qty
{
get { return _mca_min_order_qty; }
set
{
if (_mca_min_order_qty != value)
{
this.OnPropertyChanging("mca_min_order_qty", _mca_min_order_qty, value);
_mca_min_order_qty = value;
}
}
}
private System.Byte _mca_default_contractor;
[Column("mca_default_contractor", AllowNull = false)]
public virtual System.Byte mca_default_contractor
{
get { return _mca_default_contractor; }
set
{
if (_mca_default_contractor != value)
{
this.OnPropertyChanging("mca_default_contractor", _mca_default_contractor, value);
_mca_default_contractor = value;
}
}
}
}
}
}

View File

@@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]

View File

@@ -1,25 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("RUSSEK Software")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © RUSSEK Software 2012-2022")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.2.1.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.2.1")]
[assembly: System.Reflection.AssemblyProductAttribute("DynamORM")]
[assembly: System.Reflection.AssemblyTitleAttribute("Tester")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.2.1.0")]
[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://svn.dr4cul4.pl/svn/DynamORM/")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@@ -1 +0,0 @@
782bb48d5e52ed18c98c3f55de3e3a89004a0c4b

View File

@@ -1,3 +0,0 @@
is_global = true
build_property.RootNamespace = Tester
build_property.ProjectDir = D:\Source\.NET\DynamORM\Tester\

View File

@@ -1,207 +0,0 @@
{
"format": 1,
"restore": {
"D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj": {}
},
"projects": {
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
"version": "1.3.0",
"restore": {
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"projectName": "DynamORM",
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj",
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
"outputPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net472",
"net6.0",
"netstandard2.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
},
"net472": {
"targetAlias": "net472",
"projectReferences": {}
},
"netstandard2.0": {
"targetAlias": "netstandard2.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
},
"net472": {
"targetAlias": "net472",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
},
"netstandard2.0": {
"targetAlias": "netstandard2.0",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"NETStandard.Library": {
"suppressParent": "All",
"target": "Package",
"version": "[2.0.3, )",
"autoReferenced": true
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
}
}
},
"D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj": {
"version": "1.2.1",
"restore": {
"projectUniqueName": "D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj",
"projectName": "Tester",
"projectPath": "D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj",
"packagesPath": "C:\\Users\\gruss\\.nuget\\packages\\",
"outputPath": "D:\\Source\\.NET\\DynamORM\\Tester\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
],
"configFilePaths": [
"C:\\Users\\gruss\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"projectReferences": {
"D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj": {
"projectPath": "D:\\Source\\.NET\\DynamORM\\DynamORM\\DynamORM.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"dependencies": {
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.Data.Common": {
"target": "Package",
"version": "[4.3.0, )"
},
"System.Data.SqlClient": {
"target": "Package",
"version": "[4.8.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.201\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\gruss\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\gruss\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
</ItemGroup>
</Project>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

File diff suppressed because it is too large Load Diff

View File

@@ -1,32 +0,0 @@
{
"version": 2,
"dgSpecHash": "iTUnpCnHx6mmHyBOTQ18HO6L0kWB789OUUQXR34t0JvwDrvTs0VKOMZQRlmU4qKGCm57a3gzW9YJjYSkn9r4vw==",
"success": true,
"projectFilePath": "D:\\Source\\.NET\\DynamORM\\Tester\\Tester.csproj",
"expectedPackageFiles": [
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.platforms\\3.1.0\\microsoft.netcore.platforms.3.1.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.netcore.targets\\1.1.0\\microsoft.netcore.targets.1.1.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\microsoft.win32.registry\\4.7.0\\microsoft.win32.registry.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\runtime.native.system.data.sqlclient.sni\\4.7.0\\runtime.native.system.data.sqlclient.sni.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\runtime.win-arm64.runtime.native.system.data.sqlclient.sni\\4.4.0\\runtime.win-arm64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\runtime.win-x64.runtime.native.system.data.sqlclient.sni\\4.4.0\\runtime.win-x64.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\runtime.win-x86.runtime.native.system.data.sqlclient.sni\\4.4.0\\runtime.win-x86.runtime.native.system.data.sqlclient.sni.4.4.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.collections\\4.3.0\\system.collections.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.common\\4.3.0\\system.data.common.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.data.sqlclient\\4.8.3\\system.data.sqlclient.4.8.3.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.globalization\\4.3.0\\system.globalization.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.io\\4.3.0\\system.io.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection\\4.3.0\\system.reflection.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.reflection.primitives\\4.3.0\\system.reflection.primitives.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.resources.resourcemanager\\4.3.0\\system.resources.resourcemanager.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime\\4.3.0\\system.runtime.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.runtime.extensions\\4.3.0\\system.runtime.extensions.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.security.accesscontrol\\4.7.0\\system.security.accesscontrol.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.security.principal.windows\\4.7.0\\system.security.principal.windows.4.7.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.text.encoding\\4.3.0\\system.text.encoding.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.text.regularexpressions\\4.3.0\\system.text.regularexpressions.4.3.0.nupkg.sha512",
"C:\\Users\\gruss\\.nuget\\packages\\system.threading.tasks\\4.3.0\\system.threading.tasks.4.3.0.nupkg.sha512"
],
"logs": []
}