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); }