예제 #1
0
 /// <summary>
 /// Changes the name of the selected subcollection
 /// </summary>
 /// <param name="changeSubNameDTO">Object</param>
 /// <returns>True if no errors thrown</returns>
 public bool ChangeSubCollectionName(ChangeSubNameDTO changeSubNameDTO)
 {
     using (var db = new SqlConnection(_connectionString))
     {
         var sql = @"UPDATE [Collection]
                     SET [Name] = @newSubCollectionName
                     WHERE [Id] = @collectionId";
         return(db.Execute(sql, changeSubNameDTO) == 1);
     }
 }
예제 #2
0
 public IActionResult ChangeSubCollectionName(ChangeSubNameDTO changeSubNameDTO)
 {
     if (_repo.ChangeSubCollectionName(changeSubNameDTO))
     {
         return(Ok());
     }
     else
     {
         return(BadRequest());
     }
 }