Пример #1
0
 /// <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;
     }
 }
Пример #2
0
 public void Update(TestData data)
 {
     testService.Update(data);
 }