private async Task <Guid> AddPerson(PersonFaceData personFaceData) { Guid guid = await _facesService.AddPerson(personFaceData).ConfigureAwait(false); if (guid != Guid.Empty) { _dataAccessService.AddBiometricRecord(personFaceData.UserData, guid); } else { throw new Exception("Adding person failed"); } return(guid); }
public async Task <IActionResult> RegisterPerson([FromBody] BiometricPersonDataDto biometricPersonData) { PersonFaceData personFaceData = new PersonFaceData { PersonGroupId = _portalConfiguration.FacePersonGroupId + (_portalConfiguration.DemoMode ? string.Empty : biometricPersonData.Requester), PersonGuid = Guid.NewGuid(), UserData = biometricPersonData.PersonData, ImageContent = Convert.FromBase64String(biometricPersonData.ImageString) }; Guid guid = await _facesService.AddPerson(personFaceData).ConfigureAwait(false); _dataAccessService.AddBiometricRecord(biometricPersonData.PersonData, guid); return(Ok()); }