I have a stored proc:
CREATE PROCEDURE MyProc ( @P1 uniqueidentifier, @P2 int = NULL output, @P3 int = NULL output )
The signature on the C# side should be (Guid P1, int? P2, int? P3) I would think. But it's not, it's just (Guid,int,int). Furthermore, the output params are not created as output params, they're just straight "AddParameter(P2,arg,DbType.Int32)". Was this meant to work?
Best Answer
Well, it doesn't look like the native T4 templates handle this so well. We had actually built something more complex back in the VS2003 days, so I've updated it for Subsonic. The idea was that each stored proc gets a class instead of a function and has nullable properties for parameters. I've modified several templates, I'm sure I'm missing something here and this is not "production quality", but here's StoredProcedures.tt
And here's the GetSPParams function from SQLServer.ttinclude
And then the class declaration from Settings.ttinclude