public ApplicationRole Add(ApplicationRole appRole)
 {
     if (_appRoleRepository.CheckContains(x => x.Description == appRole.Description))
     {
         throw new NameDuplicatedException("Tên không được trùng");
     }
     return(_appRoleRepository.Add(appRole));
 }
Exemple #2
0
 public EntityEntry <IdentityRole> Add(IdentityRole appRole)
 {
     if (_appRoleRepository.CheckContains(x => x.Name == appRole.Name))
     {
         throw new NameDuplicatedException("Tên không được trùng");
     }
     return(_appRoleRepository.Add(appRole));
 }
 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));
 }
Exemple #5
0
 public void Add(ApplicationRole appRole)
 {
     if (!_applicationRoleRepository.CheckContain(x => x.Description.Contains(appRole.Description)))
     {
         _applicationRoleRepository.Add(appRole);
     }
     else
     {
         throw new NameDuplicateException("Tên không được trùng");
     }
 }