Skip to content

Instantly share code, notes, and snippets.

@hatelove
Created April 30, 2019 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatelove/586b8bb47ba664b1700e04ec4fa8d442 to your computer and use it in GitHub Desktop.
Save hatelove/586b8bb47ba664b1700e04ec4fa8d442 to your computer and use it in GitHub Desktop.
dapper invoke stored procedure to get return value
public string GetPassword(string accountId)
{
using (var connection = new SqlConnection("my connection string"))
{
var password = connection.Query<string>("spGetUserPassword", new {Id = accountId},
commandType: CommandType.StoredProcedure).SingleOrDefault();
return password;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment