| | |
| | | from c in _channleRepository.Where(s => s.ChannlesNum == uc.ChannleId) |
| | | select new UserChannleDto |
| | | { |
| | | Id = c.ChannlesNum, |
| | | Id = c.Id, |
| | | Name = c.ChannlesName, |
| | | }, |
| | | Remark = u.Remark, |
| | |
| | | List<UserChannle> userChannles = new List<UserChannle>(); |
| | | foreach (var item in input.ChannlesId) |
| | | { |
| | | var channleNum = item; |
| | | if (IsGuid(channleNum)) |
| | | { |
| | | channleNum = await _channleRepository.Where(x => x.Id == Guid.Parse(item)).Select(s => s.ChannlesNum).FirstOrDefaultAsync(); |
| | | } |
| | | |
| | | userChannles.Add(new UserChannle() |
| | | { |
| | | Id = Guid.NewGuid(), |
| | | ChannleId = item, |
| | | ChannleId = channleNum, |
| | | UserId = entity.Id |
| | | }); |
| | | } |
| | |
| | | await _roleRepository.DeleteAsync(id); |
| | | return Constant.SUCCESS; |
| | | } |
| | | |
| | | private bool IsGuid(string input) |
| | | { |
| | | Guid guidOutput; |
| | | return Guid.TryParse(input, out guidOutput); |
| | | } |
| | | } |
| | | } |
| | | } |