-
Notifications
You must be signed in to change notification settings - Fork 226
Open
Labels
Description
Our project has a number of stored procs that declare an output parameter and pass a value in. The EF.Reverse.POCO.v3.ttinclude T4 template includes an enum StoredProcedureParameterMode { In, InOut, Out}, but InOut is not referenced. As a result, the application fails because the passed value is nullified when the procedure is called.
eg:
CREATE PROCEDURE [config].[P_XXX]
@groupId INT OUTPUT, _-- a value is also passed in_
@clientId INT,
@displayName VARCHAR(30),EF.Reverse.POCO.v3.ttinclude.txt
@description VARCHAR(100),
@result INT OUTPUT,
@failureReason VARCHAR(4000) OUTPUT
ASgenerated code:
public int P_XXX(out int? groupId, int? clientId, string displayName,
string description, out int? result, out string failureReason)
{
var groupIdParam = new SqlParameter { ParameterName = "@groupId",
SqlDbType = SqlDbType.Int,
Direction = ParameterDirection.Output,
Precision = 10,
Scale = 0 }; _// Direction should be InputOutput; missing Value = argument_I modified the T4 (see attachment) to accommodate InputOutput parameters, which are now generated in code as "ref" instead of "out". This works, but I'd like to be able to override the stored proc parameter mode in my .tt file.