public ApplicationRole Add(ApplicationRole appRole)
 {
     if (_appRoleRepository.CheckContains(x => x.Name == appRole.Name))
     {
         throw new NameDuplicatedException("Tên không được trùng");
     }
     return(_appRoleRepository.Add(appRole));
 }
Пример #2
0
 public ApplicationRole Add(ApplicationRole appRole)
 {
     if (_appRoleRepository.CheckContains(x => x.Description == appRole.Description))
     {
         throw new Exception("Tên không được trùng");
     }
     return(_appRoleRepository.Add(appRole));
 }
Пример #3
0
 public ApplicationRole Add(ApplicationRole appRole)
 {
     if (_appRoleRepository.CheckContains(x => x.Description == appRole.Description) || _appRoleRepository.CheckContains(x => x.Name == appRole.Name))
     {
         throw new NameDuplicatedException("Mô tả hoặc tên quyền không được trùng với dữ liệu đã có");
     }
     return(_appRoleRepository.Add(appRole));
 }
 public AppRole Add(AppRole appRole)
 {
     appRole.IsDeleted = false;
     if (_appRole.CheckContains(x => x.Description == appRole.Description))
     {
         throw new NameDuplicatedException("Tên không được trùng");
     }
     return(_appRole.Add(appRole));
 }