问题
I've implemented a data access layer that populates generic entities from a datareader using a variation of the third monkey approach (http://www.codeproject.com/KB/database/DynamicMethod_ILGenerator.aspx). This works well, performs well and saves me writing loads of repetetive code for data retrieval.
Now I want to add methods that take a generic entity and convert it to a parameter list for feeding to a stored proc so that I can add data persistence to my monkey's trick collection.
I found some guidance at: http://msdn.microsoft.com/en-us/library/ms973259.aspx and some sample code in the autosproc solution. It looks good on paper and I intend to incorporate this but a quick google did not turn up much in the way of user experiences of implementing autosproc and I am looking for a thumbs up (or down) from anyone who has been there and done that already.
So, have you used autosproc? Did it work well for you? Are there any gaping flaws in performance or elsewhere that would make it unsuitable in an enterprise application?
Advice appreciated.
回答1:
I think it's easier to refer you to this question, where my answer contains links to your AutoSproc thing: TSQL - Parse Execution Plan to determine columns to be returned by a stored procedure
To summarise, I didn't like it: it caused too many issues.
(Just poking around unanswered questions and found this one)
来源:https://stackoverflow.com/questions/626933/are-there-any-gotchas-or-good-reasons-not-to-use-autosproc-for-stored-procedure