How to Perform Procedures with Dapper

Asked

Viewed 2,880 times

4

How can I run a store with Dapper?

1 answer

8


Assuming you wanted to get the result in a variable of type Cliente.

var cliente = connection.Query<Cliente>("spClientes", new {Id = 1}, 
                                    commandType: CommandType.StoredProcedure).First();

The first parameter is the name of the precedent, the second is the parameters passed to it and the third is the type of command that will be executed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.