예제 #1
0
        void IUserRoleService.Update(int userId, string roleName)
        {
            var role = roleRepository.GetMany(r => r.Name.Equals(roleName)).FirstOrDefault();

            if (role == null)
            {
                return;
            }
            MyUserRole obj = new MyUserRole()
            {
                UserId = userId,
                RoleId = role.Id
            };



            repository.Delete(ur => ur.UserId == userId);
            if (!roleName.Equals("Moderator"))
            {
                userCategoryRepository.Delete(uc => uc.UserId == userId);
            }
            repository.Add(obj);
        }
예제 #2
0
 public void Delete(UserCategory userCategory)
 {
     _userCategoryRepository.Delete(userCategory);
 }