/// <summary> /// Updates the <see cref="Test" /> with specified data. /// </summary> /// <param name="data">The data.</param> /// <returns> /// The result of Update operation. /// </returns> /// <exception cref="InvalidOperationException">Id is not valid.</exception> public bool Update(TestData data) { var test = testRepository.Find(data.Id); if (test == null) { throw new InvalidOperationException("Id is not valid"); } test.Name = data.Name; try { testRepository.Save(); return true; } catch (Exception) { return false; } }
public void Update(TestData data) { testService.Update(data); }