Skip to content

Instantly share code, notes, and snippets.

@mmerriweather
Created December 9, 2017 15:33
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 mmerriweather/c84977d11ecf2549640eb4f6b78c3c64 to your computer and use it in GitHub Desktop.
Save mmerriweather/c84977d11ecf2549640eb4f6b78c3c64 to your computer and use it in GitHub Desktop.
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