I'm evaluating using the Data Access Application Block 5.0 at work since we are married to stored procedures for the foreseeable future. I like the simplicity and the Mapper that is included in this, but what is turning me off is that there doesn't seem to be a way to specify an array of parameters, or even better some kind of "query by example" object, to the stored procedure call that will automatically create the parameters based on your criteria. Imagine a search customer feature, where you can specify one or more properties that need to be searched (let's assume we have a stored proc already created with nullable fields).
What I'd like to do is something like this:
var customerQuery = new { FirstName = "John", LastName = "Doe" }
var result = db.ExecuteSprocAccessor("SearchCustomers", customerQuery);
and have the anonymous object turned into the various SqlParameter
objects.
Is something like this possible? The examples that I've seen on MSDN seem to just show specifying individual parameters, by hand, without any idea which parameter is which.