/// <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); } }
public IActionResult ChangeSubCollectionName(ChangeSubNameDTO changeSubNameDTO) { if (_repo.ChangeSubCollectionName(changeSubNameDTO)) { return(Ok()); } else { return(BadRequest()); } }