UserTaskHistoryService.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. 
  2. using MTWorkHR.Application.Models;
  3. using MTWorkHR.Core.UnitOfWork;
  4. using MTWorkHR.Application.Services.Interfaces;
  5. using MTWorkHR.Core.Entities;
  6. using Microsoft.AspNetCore.Identity;
  7. using MTWorkHR.Application.Mapper;
  8. using MTWorkHR.Core.Global;
  9. using MTWorkHR.Infrastructure.Entities;
  10. using MTWorkHR.Infrastructure.Repositories;
  11. using MTWorkHR.Infrastructure.UnitOfWorks;
  12. using MTWorkHR.Core.IRepositories.Base;
  13. namespace MTWorkHR.Application.Services
  14. {
  15. public class UserTaskHistoryService : BaseService<UserTaskHistory, UserTaskHistoryDto, UserTaskHistoryDto>, IUserTaskHistoryService
  16. {
  17. private readonly IUnitOfWork _unitOfWork;
  18. public UserTaskHistoryService(IUnitOfWork unitOfWork) : base(unitOfWork)
  19. {
  20. _unitOfWork = unitOfWork;
  21. }
  22. //public override async Task<UserTaskHistoryDto> GetById(long id)
  23. //{
  24. // var entity = await _unitOfWork.UserTaskAttachment.GetByIdAsync(id);
  25. // var response = MapperObject.Mapper.Map<UserTaskHistoryDto>(entity);
  26. // return response;
  27. //}
  28. //public override async Task<UserTaskHistoryDto> Create(UserTaskHistoryDto input)
  29. //{
  30. // var entity = MapperObject.Mapper.Map<UserTaskAttachment>(input);
  31. // if (entity is null)
  32. // {
  33. // throw new AppException(ExceptionEnum.MapperIssue);
  34. // }
  35. // var task = await _unitOfWork.UserTaskAttachment.AddAsync(entity);
  36. // await _unitOfWork.CompleteAsync();
  37. // var response = MapperObject.Mapper.Map<UserTaskHistoryDto>(task);
  38. // return response;
  39. //}
  40. //public override async Task<UserTaskHistoryDto> Update(UserTaskHistoryDto input)
  41. //{
  42. // var entitiy = await _unitOfWork.UserTask.GetByIdAsync(input.Id);
  43. // if (entitiy == null)
  44. // throw new AppException(ExceptionEnum.RecordNotExist);
  45. // MapperObject.Mapper.Map(input, entitiy, typeof(UserTaskHistoryDto), typeof(UserTaskHistory));
  46. // await _unitOfWork.CompleteAsync();
  47. // return input;
  48. //}
  49. }
  50. }