Beispiel #1
0
        public ActionResult TrainAllGroups(string id, string language, string db)
        {
            if (!IsSitecoreUser())
            {
                return(LoginPage());
            }

            Dictionary <Guid, string> groupIdSet = PersonGroupService.GetAllGroupItems(db).ToDictionary(a => a.ID.Guid, b => b[SearchSettings.FaceEntityIdFieldId]);

            if (!groupIdSet.Any())
            {
                return(View("TrainAllGroups"));
            }

            groupIdSet.ForEach(gid => FaceService.TrainPersonGroup(gid.Value));

            return(View("TrainAllGroups", model: JsonConvert.SerializeObject(groupIdSet)));
        }