This commit is contained in:
@@ -607,7 +607,14 @@ namespace DynamORM
|
||||
/// <returns>Returns edited <see cref="System.Data.IDbCommand"/> instance.</returns>
|
||||
public static IDbCommand SetParameter(this IDbCommand command, string parameterName, object value)
|
||||
{
|
||||
((IDbDataParameter)command.Parameters[parameterName]).Value = value;
|
||||
try
|
||||
{
|
||||
((IDbDataParameter)command.Parameters[parameterName]).Value = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(string.Format("Error setting parameter {0} in command {1}", parameterName, command.CommandText ?? string.Empty), ex);
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
@@ -619,7 +626,14 @@ namespace DynamORM
|
||||
/// <returns>Returns edited <see cref="System.Data.IDbCommand"/> instance.</returns>
|
||||
public static IDbCommand SetParameter(this IDbCommand command, int index, object value)
|
||||
{
|
||||
((IDbDataParameter)command.Parameters[index]).Value = value;
|
||||
try
|
||||
{
|
||||
((IDbDataParameter)command.Parameters[index]).Value = value;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new ArgumentException(string.Format("Error setting parameter {0} in command {1}", index, command.CommandText ?? string.Empty), ex);
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,9 @@ namespace DynamORM.Mapper
|
||||
/// <summary>Gets value setter.</summary>
|
||||
public Action<object, object> Setter { get; private set; }
|
||||
|
||||
/// <summary>Gets the property information.</summary>
|
||||
public PropertyInfo PropertyInfo { get; private set; }
|
||||
|
||||
/// <summary>Gets name of property.</summary>
|
||||
public string Name { get; private set; }
|
||||
|
||||
@@ -83,6 +86,7 @@ namespace DynamORM.Mapper
|
||||
/// <param name="attr">Column attribute if exist.</param>
|
||||
public DynamicPropertyInvoker(PropertyInfo property, ColumnAttribute attr)
|
||||
{
|
||||
PropertyInfo = property;
|
||||
Name = property.Name;
|
||||
Type = property.PropertyType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user