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

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) public async Task<int> CopyAsync(int idWell, int idWellTarget, IEnumerable<int> contactIds, CancellationToken token)
{ {
var dbContacts = await GetContacts(idWell, contactIds, token); var newContacts = await GetContacts(idWell, contactIds, token);
if (!dbContacts.Any()) if (!newContacts.Any())
throw new ForbidException("contacts not found"); throw new ForbidException("contacts not found");
foreach (var dbContact in dbContacts) foreach (var newContact in newContacts)
{ {
dbContact.IdWell = idWellTarget; newContact.IdWell = idWellTarget;
dbContact.Id = default; newContact.Id = default;
} }
await db.Contacts.AddRangeAsync(dbContacts); await db.Contacts.AddRangeAsync(newContacts);
return await db.SaveChangesAsync(token); return await db.SaveChangesAsync(token);
} }