-
-
Save hatelove/586b8bb47ba664b1700e04ec4fa8d442 to your computer and use it in GitHub Desktop.
dapper invoke stored procedure to get return value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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