Created
December 9, 2017 15:33
-
-
Save mmerriweather/c84977d11ecf2549640eb4f6b78c3c64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
namespace Team4Calories.DAL | |
{ | |
public class UserRepository : Repository | |
{ | |
public int Insert(User user) | |
{ | |
using (IDbConnection dbConnection = Connection) | |
{ | |
dbConnection.Open(); | |
return dbConnection.Query<InsertID>("Team4Calories.DAL.InsertUser", user, commandType: CommandType.StoredProcedure).First().ID; | |
} | |
} | |
public void Delete(User user) | |
{ | |
using (IDbConnection dbConnection = Connection) | |
{ | |
dbConnection.Open(); | |
dbConnection.Execute("Team4Calories.DAL.DeleteUser", user, commandType: CommandType.StoredProcedure); | |
} | |
} | |
public void Update(User user) | |
{ | |
using (IDbConnection dbConnection = Connection) | |
{ | |
dbConnection.Open(); | |
dbConnection.Execute("Team4Calories.DAL.UpdateUser", user, commandType: CommandType.StoredProcedure); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment