public virtual List <User> GetUsers(string users, WorkflowBaseEntity wfEntity) { var result = new List <User>(); //If users is a list of emails if (users.Contains("@")) { var emails = users.Split(';'); foreach (var email in emails) { if (!string.IsNullOrEmpty(email)) { var user = _userRepository.GetAll().Where(u => u.Email == email).FirstOrDefault(); if (user != null) { result.Add(user); } //in case the email is not in BaseEAM, such as SR was created anonymously else { result.Add(new User { Email = email, Phone = "" }); } } } } // "." represents a method invocation // this case is not a C# method else if (!users.Contains(".")) { //if users is an assignment group //check if wfEntity has SiteId => this entity is at Site Level object value = wfEntity.GetType().GetProperty("SiteId").GetValue(wfEntity, null); long? siteId = null; if (value != null) { siteId = (long?)value; } result = _assignmentGroupService.GetUsers(users, siteId); } //if users is a C# method else { // already handled in Task Activity } return(result); }