forked from ddrilling/AsbCloudServer
правка названия переменной
This commit is contained in:
parent
ac8be4f3db
commit
875498a4a6
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user