From c07ca4dbacfa30a5922bf45b630293a37ef37261 Mon Sep 17 00:00:00 2001 From: jojo aquino Date: Thu, 3 Apr 2025 22:36:27 +0100 Subject: [PATCH] fix missing id document id --- .../EnotaryoPH.Web/Pages/BaseTakeSelfiePageModel.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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;