private async Task <DialogTurnResult> BookAppointmentStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var userData = await UserStateAccessor.GetAsync(stepContext.Context, () => new Models.UserData(), cancellationToken); var text = stepContext.Context.Activity.Text; userData.Name = text; // Create a person using the customer information var personId = await _faceRecognitionService.CreatePersonAsync(userData.Name); userData.PersonId = personId.ToString(); await stepContext.Context.SendActivityAsync("Great! I've booked you in.", cancellationToken : cancellationToken); return(await stepContext.PromptAsync(BookAppointment, new PromptOptions { Prompt = MessageFactory.Text("Take a selfie if you'd like our team to be able to recognize you on your arrival") }, cancellationToken)); }
public async Task <IActionResult> CreatePerson(string personName, IFormFile file) { if (string.IsNullOrEmpty(personName)) { return(BadRequest("[personName] is required")); } if (file == null || file.Length == 0) { return(BadRequest("[file] is required")); } var response = await _faceRecognitionService.CreatePersonAsync(personName); using (var fileStream = file.OpenReadStream()) { await _faceRecognitionService.AddPersonFaceAsync(response, fileStream); } return(Ok(response)); }