AttachService.cs 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. using System.Threading.Tasks;
  2. using GxPress.Repository.Interface.Attach;
  3. using GxPress.Repository.Interface.Category;
  4. using GxPress.Service.Interface.Attach;
  5. namespace GxPress.Service.Implement.Attach
  6. {
  7. public class AttachService : IAttachService
  8. {
  9. private readonly ICategoryRepository categoryRepository;
  10. private readonly IAttachRepository attachRepository;
  11. public AttachService(ICategoryRepository categoryRepository, IAttachRepository attachRepository)
  12. {
  13. this.categoryRepository = categoryRepository;
  14. this.attachRepository = attachRepository;
  15. }
  16. public async Task<int> InsertAsync(Entity.tede2.Attach.Attach note)
  17. {
  18. //note.CategoryName = await categoryRepository.GetCategoryParentAsync(note.CategoryId, note.CategoryName);
  19. return await attachRepository.InsertAsync(note);
  20. }
  21. public async Task<bool> UpdateAsync(Entity.tede2.Attach.Attach note)
  22. {
  23. //note.CategoryName = await categoryRepository.GetCategoryParentAsync(note.CategoryId, note.CategoryName);
  24. return await attachRepository.UpdateAsync(note);
  25. }
  26. }
  27. }