public IListMgrItem AddListMgrItem(IListMgrItem listMgrItem) { var sql = @" INSERT INTO ListMgrItems (Description) VALUES (@Description); SELECT last_insert_rowid()"; var newId = _connection.Query <int>(sql, listMgrItem).Single(); return(GetListMgrItem(newId)); }
public int UpdateListMgrItem(IListMgrItem listMgrItem) { var sql = @"UPDATE ListMgrItems SET Description = @Description WHERE ListMgrID = @ListMgrID"; var affectedRows = _connection.Execute(sql, listMgrItem); if (affectedRows == 0) { throw new NotFoundException(); } return(affectedRows); }