I need to get users within SPFieldUserValueCollection
and set them inside SPUserCollection
, but I have the following build error:
The type ‘Microsoft.SharePoint.SPUserCollection’ has no constructors defined
SPFieldUserValueCollection employees = item["employees"] as SPFieldUserValueCollection; SPUserCollection users = new SPUserCollection(); if (values != null) { foreach (SPFieldUserValue userValue in employees) { users.Add(userValue.User.LoginName, userValue.User.Email, userValue.User.Name, userValue.User.Notes); } return users; }
How I can initialize SPUserCollection
?