StudentsService.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using TEAMModelOS.Model.Analysis.Models;
  6. using TEAMModelOS.SDK.Module.AzureTable.Interfaces;
  7. using TEAMModelOS.Service.BaseInfo.Interfaces;
  8. namespace TEAMModelOS.Service.BaseInfo.Implements
  9. {
  10. public class StudentsService : IStudentsService
  11. {
  12. IAzureTableDBRepository azureTableDBRepository;
  13. public StudentsService(IAzureTableDBRepository _azureTableDBRepository) {
  14. azureTableDBRepository = _azureTableDBRepository;
  15. }
  16. public async Task<Students> Delete(Students stu)
  17. {
  18. await azureTableDBRepository.Delete<Students>(stu);
  19. return stu;
  20. }
  21. public async Task<List<Students>> FindList(Dictionary<string, object> enlist)
  22. {
  23. List<Students> stus = await azureTableDBRepository.FindListByDict<Students>(enlist);
  24. return stus;
  25. }
  26. public async Task<Students> saveOrUpdate(Students stu)
  27. {
  28. //Students stu = new Students();
  29. //stu = await azureTableDBRepository.FindById<Students>(dict["id"]);
  30. await azureTableDBRepository.SaveOrUpdate<Students>(stu);
  31. return stu;
  32. }
  33. }
  34. }