public Issue Update(Issue issue) { const string sqlQuery = "UPDATE Issue SET " + "Description = @Description " + "WHERE Id = @Id " + "SELECT * FROM Issue WHERE Id = @Id"; var newIssue = _dbConnection.QueryWithRetry<Issue>(sqlQuery, issue).Single(); return newIssue; }
public Issue Add(Issue issue) { const string sqlQuery = "INSERT INTO Issue (Description) " + "VALUES (@Description)" + "SELECT Id FROM Issue WHERE Id = scope_identity()"; var issueId = _dbConnection.QueryWithRetry<int>(sqlQuery, issue).Single(); issue.Id = issueId; return issue; }