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)
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user