SubscriptionService.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Microsoft.AspNetCore.Identity;
  2. using Microsoft.AspNetCore.WebUtilities;
  3. using Microsoft.EntityFrameworkCore;
  4. using Microsoft.Extensions.Configuration;
  5. using MTWorkHR.Application.Identity;
  6. using MTWorkHR.Application.Mapper;
  7. using MTWorkHR.Application.Models;
  8. using MTWorkHR.Core.Global;
  9. using MTWorkHR.Core.IRepositories;
  10. using MTWorkHR.Core.UnitOfWork;
  11. using MTWorkHR.Infrastructure.Entities;
  12. using MTWorkHR.Application.Services.Interfaces;
  13. using MTWorkHR.Core.Email;
  14. using MTWorkHR.Core.Entities;
  15. using MTWorkHR.Infrastructure.UnitOfWorks;
  16. using System.Linq.Dynamic.Core;
  17. namespace MTWorkHR.Application.Services
  18. {
  19. public class SubscriptionService : BaseService<SubscriptionConfiguration, SubscriptionConfigurationDto, SubscriptionConfigurationDto>, ISubscriptionService
  20. {
  21. private readonly IUnitOfWork _unitOfWork;
  22. //private readonly AppSettingsConfiguration _configuration;
  23. //private readonly GlobalInfo _globalInfo;
  24. public SubscriptionService(IUnitOfWork unitOfWork) : base(unitOfWork)
  25. {
  26. _unitOfWork = unitOfWork;
  27. }
  28. public override async Task<SubscriptionConfigurationDto> GetById(long id)
  29. {
  30. var entity = await _unitOfWork.SubscriptionConfiguration.GetByIdAsync(id);
  31. var response = MapperObject.Mapper.Map<SubscriptionConfigurationDto>(entity);
  32. return response;
  33. }
  34. }
  35. }