diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/BaseTakeSelfiePageModel.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/BaseTakeSelfiePageModel.cs index 0151b25..54e51c6 100644 --- a/EnotaryoPH/EnotaryoPH.Web/Pages/BaseTakeSelfiePageModel.cs +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/BaseTakeSelfiePageModel.cs @@ -62,14 +62,8 @@ namespace EnotaryoPH.Web.Pages var selfieEntity = CreateOrUpdateSelfie(selfieImage); selfieEntity.Transaction = CurrentTransaction; - if (_notaryoDBContext.Entry(selfieEntity).State == EntityState.Detached) - { - _notaryoDBContext.Add(selfieEntity); - } - else - { - _notaryoDBContext.Update(selfieEntity); - } + selfieEntity.IdentificationDocumentID = identificationDocument.IdentificationDocumentID; + _notaryoDBContext.UpdateOrCreate(selfieEntity); _notaryoDBContext.SaveChanges(); } return isMatchSuccess;