TelGroupRepository.cs 929 B

12345678910111213141516171819202122232425
  1. using Hotline.CallCenter.Tels;
  2. using Hotline.Repository.SqlSugar.DataPermissions;
  3. using SqlSugar;
  4. using XF.Domain.Dependency;
  5. namespace Hotline.Repository.SqlSugar.CallCenter;
  6. public class TelGroupRepository : BaseRepository<TelGroup>, ITelGroupRepository, IScopeDependency
  7. {
  8. public TelGroupRepository(ISugarUnitOfWork<HotlineDbContext> uow, IDataPermissionFilterBuilder dataPermissionFilterBuilder) : base(uow, dataPermissionFilterBuilder)
  9. {
  10. }
  11. public async Task UpdateNavTelsAsync(TelGroup group, CancellationToken cancellationToken = default)
  12. {
  13. await Db.UpdateNav(group)
  14. .Include(d => d.Tels, new UpdateNavOptions { ManyToManyIsUpdateA = true })
  15. .ExecuteCommandAsync();
  16. }
  17. public async Task AddNavTelsAsync(TelGroup group, CancellationToken cancellationToken = default)
  18. {
  19. await Db.InsertNav(group).Include(d => d.Tels).ExecuteCommandAsync();
  20. }
  21. }