I would like to pass poco properties to an stored procedure (update and add the Object) With earlier versions of Enterprise Library (e.g. v2.0) I can do something like this:
var arrParam = SqlHelperParameterCache.GetSpParameterSet(ConnectionString(),
SprocNameSet);
for (int x = 0; x <= arrParam.Length - 1; x++)
{
System.Reflection.PropertyInfo pi =
dataObject.GetType()
.GetProperty(arrParam[x].ParameterName
.Substring(1, Convert.ToInt32(arrParam[x].ParameterName.Length) - 1));
arrParam[x].Value = pi.GetValue(myDataObject, null);
}
SqlHelper.ExecuteScalar(ConnectionString(),
CommandType.StoredProcedure,
SprocNameSet,
arrParam);
But with Version 5.0 (maybe earlier?) the SqlHelperParameterCache.GetSpParameterSet method is gone.
The question is: how can I get the stored-proc-Parameters and fill these with the poco-properties-values?