public Result <Permission> Delete(Guid userId, Guid id) { Result <Permission> result = new Result <Permission>(); List <RolePermission> list = _rolePermissionRepository.GetByPermissionId(userId, id); if (list.Count > 0) { result.ErrorList = CoreFaces.Identity.Helper.FluentValidationHelper.GenerateErrorList("Bu kayıt RolePermission tablosunda kullanıldığı için silinemez."); } else { result.Status = _permissionRepository.Delete(userId, id); } return(result); }
public List <RolePermission> GetByPermissionId(Guid userId, Guid permissionId) { return(_rolePermissionRepository.GetByPermissionId(userId, permissionId)); }