コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }