From 875498a4a6f68a32b03f1e3d20c6e6719ffc1b7b Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 26 Jul 2024 10:18:00 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/WellContactService.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellContactService.cs b/AsbCloudInfrastructure/Services/WellContactService.cs index 525ce6f9..7e628e9e 100644 --- a/AsbCloudInfrastructure/Services/WellContactService.cs +++ b/AsbCloudInfrastructure/Services/WellContactService.cs @@ -92,17 +92,17 @@ namespace AsbCloudInfrastructure.Services public async Task CopyAsync(int idWell, int idWellTarget, IEnumerable contactIds, CancellationToken token) { - var dbContacts = await GetContacts(idWell, contactIds, token); - if (!dbContacts.Any()) + var newContacts = await GetContacts(idWell, contactIds, token); + if (!newContacts.Any()) throw new ForbidException("contacts not found"); - foreach (var dbContact in dbContacts) + foreach (var newContact in newContacts) { - dbContact.IdWell = idWellTarget; - dbContact.Id = default; + newContact.IdWell = idWellTarget; + newContact.Id = default; } - await db.Contacts.AddRangeAsync(dbContacts); + await db.Contacts.AddRangeAsync(newContacts); return await db.SaveChangesAsync(token); }