Skip to content

CommandType#601

Open
mattewre wants to merge 1 commit intosqlkata:masterfrom
mattewre:commandType
Open

CommandType#601
mattewre wants to merge 1 commit intosqlkata:masterfrom
mattewre:commandType

Conversation

@mattewre
Copy link

@mattewre mattewre commented Sep 8, 2022

QueryFactory Select and Statement accept optional "commandType" supported by Dapper. Useful for Stored Procedure.

Example

var parameters = new DynamicParameters();
parameters.Add("@param1", 2);
parameters.Add("@param1out", dbType: DbType.Int32, direction: ParameterDirection.Output);

var result = db.Select("SP_TEST", parameters, commandType: CommandType.StoredProcedure);
var param1out = parameters.Get<int>("@param1out");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants