LabResultRepository.cs 642 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace DataAccess.Repository
  7. {
  8. public static class LabResultRepository
  9. {
  10. public static List<LabResult> FindLabResultsByTestNo(string TestNo)
  11. {
  12. DB db = new DB();
  13. return db.LabResult.Where(t => object.Equals(t.TestNo, TestNo)).ToList();
  14. }
  15. public static LabResult AddLabResult(LabResult labResult)
  16. {
  17. DB db = new DB();
  18. db.LabResult.Add(labResult);
  19. db.SaveChanges();
  20. return labResult;
  21. }
  22. }
  23. }