public bool AddUserinGroup(List <int> userList, int groupId) { try { for (var r = 0; r < userList.Count; r++) { var userId = userList[r]; var isPresent = _groupManagement.SearchUserInGroupwithGroupId(userId, groupId); if (isPresent.Count == 0) { _groupManagement.AddUserInGroup(userId, groupId); } } return(true); } catch (Exception) { return(false); } }