Esempio n. 1
0
 public static int InsertTestResult(TestResult testResult)
 {
     using (var entities = new MarkrApiEntities())
     {
         entities.TestResults.Add(testResult);
         return(entities.SaveChanges());
     }
 }
Esempio n. 2
0
 public static int InsertTestResults(List <TestResult> testResults)
 {
     using (var entities = new MarkrApiEntities())
     {
         entities.TestResults.AddRange(testResults);
         return(entities.SaveChanges());
     }
 }
Esempio n. 3
0
 public static int DeleteTestResults(int testId)
 {
     using (var entities = new MarkrApiEntities())
     {
         var testResult = entities.TestResults.Where(r => r.TestId == testId).ToList();
         entities.TestResults.RemoveRange(testResult);
         return(entities.SaveChanges());
     }
 }
Esempio n. 4
0
 public static int DeleteTestResult(int testId, int studentNumber)
 {
     using (var entities = new MarkrApiEntities())
     {
         var testResult = entities.TestResults.Where(r => r.TestId == testId && r.StudentNumber == studentNumber).First();
         entities.TestResults.Remove(testResult);
         return(entities.SaveChanges());
     }
 }