правка названия переменной

This commit is contained in:
Olga Nemt 2024-07-26 10:18:00 +05:00
parent ac8be4f3db
commit 875498a4a6

View File

@ -92,17 +92,17 @@ namespace AsbCloudInfrastructure.Services
public async Task<int> CopyAsync(int idWell, int idWellTarget, IEnumerable<int> 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);
}