static async Task <Tuple <List <Face>, List <User> > > FaceIdentification(FaceIdentificationContext appContext) { var IReturn = new Tuple <List <Face>, List <User> >(new List <Face>(), new List <User>()); if (appContext.ImageUrl == null) { throw new ErrorMsg("imageDoesntExist", "image not found maybe link is not attached "); } List <Face> Faces = await FaceService.FaceDetection(appContext.ImageUrl); string personGroupId = MappingService.GetFromMapping(appContext.AppID, appContext.Context.Id); //get from mapping if (MappingService.IsPersonGroupExist(appContext.AppID, appContext.Context.Id)) //check if context has group ? get groupID : return detection in faces and emty users { IReturn = await FaceService.Identify(personGroupId, Faces, appContext); } IReturn = Tuple.Create(Faces, new List <User>()); StorageService.uploadImageAsync(appContext.ImageUrl, ImageType.Url, appContext.AppID, appContext.Context.Id); return(IReturn); }