コード例 #1
0
 /// <summary>
 /// Adds a parameter for each property of the provided object, with its corresponding value
 /// as the parameter value. <see cref="Guid"/> are translated to
 /// a 16 bytes array. Null values will insert <see cref="DBNull.Value"/>.
 /// </summary>
 public static void AddPropertiesAsParameters(this IDbCommand command, object parameters)
 {
     foreach (var parameter in parameters.ToExpando())
     {
         command.AddObjectParameter(parameter.Key, parameter.Value);
     }
 }