diff --git a/CompanyManagment.Application/InstitutionContractApplication.cs b/CompanyManagment.Application/InstitutionContractApplication.cs index 7ec1cc53..68b2bb1e 100644 --- a/CompanyManagment.Application/InstitutionContractApplication.cs +++ b/CompanyManagment.Application/InstitutionContractApplication.cs @@ -1516,8 +1516,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication .Where(x => x.WorkshopCreated && x.WorkshopId is > 0).ToList(); var currentWorkshops = institutionContract.WorkshopGroup.CurrentWorkshops.ToList(); - var accountId = _contractingPartyRepository - .GetAccountByPersonalContractingParty(institutionContract.ContractingPartyId).Id; + var account = _contractingPartyRepository + .GetAccountByPersonalContractingParty(institutionContract.ContractingPartyId); + var accountId = account.Id; foreach (var createdWorkshop in initialCreatedWorkshops) { if (currentWorkshops.Any(x => x.WorkshopId == createdWorkshop.WorkshopId)) diff --git a/CompanyManagment.EFCore/Repository/PersonalContractingPartyRepository.cs b/CompanyManagment.EFCore/Repository/PersonalContractingPartyRepository.cs index e0225194..0f966904 100644 --- a/CompanyManagment.EFCore/Repository/PersonalContractingPartyRepository.cs +++ b/CompanyManagment.EFCore/Repository/PersonalContractingPartyRepository.cs @@ -245,7 +245,7 @@ public class PersonalContractingPartyRepository : RepositoryBase x.id == accId && x.IsActiveString == "true").Select(x => + return _accountContext.Accounts.Where(x => x.id == accId).Select(x => new AccountViewModel() { Id = x.id, @@ -845,8 +845,7 @@ public class PersonalContractingPartyRepository : RepositoryBase ActiveAllAsync(long id) { OperationResult result = new OperationResult(); - await using var transaction =await _context.Database.BeginTransactionAsync(); - await using var accountTransaction = await _accountContext.Database.BeginTransactionAsync(); + try { var personel = _context.PersonalContractingParties @@ -890,15 +889,12 @@ public class PersonalContractingPartyRepository : RepositoryBase