From e61e7533001c09b069416220cf1d07a9f426155b Mon Sep 17 00:00:00 2001 From: maksim Date: Mon, 9 Dec 2024 23:59:28 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D0=B7=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implements/EmployeeStorage.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs b/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs index 4d78289..6d39cb8 100644 --- a/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs +++ b/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs @@ -125,9 +125,12 @@ namespace EmployeeManagmentDataBaseImplement.Implements if (entity != null) { + // Убедимся, что связи остаются нетронутыми + entity.PhisicalPersonsId = null; // Удаляем связь, если это нужно context.Employees.Remove(entity); context.SaveChanges(); } } + } }