public void SaveTestsHistory(TestsHistory testToSave)
 {
     try
     {
         string path = ApplicationData.Current.LocalFolder.Path + "/" + UserId + _resources["HistoryFileName"].ToString();
         if (!File.Exists(path))
         {
             File.Create(path);
         }
         using (StreamWriter w = File.AppendText(path))
         {
             string fileContent = String.Format("{0};{1};{2}", testToSave.TestsDate, testToSave.DeckName, testToSave.Result);
             w.WriteLine(fileContent);
         }
     }
     catch (Exception)
     {
         SaveTestsHistory(testToSave);
     }
 }
Exemple #2
0
 public int AddTestHistory([FromBody] TestsHistory newTest)
 {
     _unitOfWork.TestsHistory.Add(newTest);
     _unitOfWork.Commit();
     return(1);
 }