Small improvements

This commit is contained in:
2025-01-24 16:03:30 +01:00
parent 86c22cfe85
commit 81c4915d16
2 changed files with 9 additions and 43 deletions

View File

@@ -6002,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>
@@ -13327,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;
} }
} }
@@ -14014,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>
@@ -14110,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(
@@ -14128,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(

View File

@@ -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(