diff --git a/src/portalbackend/PortalBackend.DBAccess/Models/TechnicalUserProfileInformation.cs b/src/portalbackend/PortalBackend.DBAccess/Models/TechnicalUserProfileInformation.cs index 2950d4d457..a1ac89ebd2 100644 --- a/src/portalbackend/PortalBackend.DBAccess/Models/TechnicalUserProfileInformation.cs +++ b/src/portalbackend/PortalBackend.DBAccess/Models/TechnicalUserProfileInformation.cs @@ -1,5 +1,4 @@ /******************************************************************************** - * Copyright (c) 2022 BMW Group AG * Copyright (c) 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional diff --git a/src/portalbackend/PortalBackend.DBAccess/Repositories/TechnicalUserProfileRepository.cs b/src/portalbackend/PortalBackend.DBAccess/Repositories/TechnicalUserProfileRepository.cs index d4d4e70b6c..d2c5161359 100644 --- a/src/portalbackend/PortalBackend.DBAccess/Repositories/TechnicalUserProfileRepository.cs +++ b/src/portalbackend/PortalBackend.DBAccess/Repositories/TechnicalUserProfileRepository.cs @@ -20,7 +20,6 @@ using Microsoft.EntityFrameworkCore; using Org.Eclipse.TractusX.Portal.Backend.Framework.DBAccess; -using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities; @@ -71,16 +70,16 @@ public void RemoveTechnicalUserProfilesForOffer(Guid offerId) /// public Task<(bool IsUserOfProvidingCompany, IEnumerable Information)> GetTechnicalUserProfileInformation(Guid offerId, Guid usersCompanyId, OfferTypeId offerTypeId, IEnumerable externalUserRoles) => - _context.Offers - .Where(x => x.Id == offerId && x.OfferTypeId == offerTypeId) - .Select(x => new ValueTuple>( - x.ProviderCompanyId == usersCompanyId, - x.TechnicalUserProfiles.Select(tup => new TechnicalUserProfileInformationTransferData( - tup.Id, - tup.TechnicalUserProfileAssignedUserRoles - .Select(ur => new UserRoleInformationTransferData( - ur.UserRole!.Id, - ur.UserRole.UserRoleText, - externalUserRoles.Contains(ur.UserRoleId))))))) - .SingleOrDefaultAsync(); + _context.Offers + .Where(x => x.Id == offerId && x.OfferTypeId == offerTypeId) + .Select(x => new ValueTuple>( + x.ProviderCompanyId == usersCompanyId, + x.TechnicalUserProfiles.Select(tup => new TechnicalUserProfileInformationTransferData( + tup.Id, + tup.TechnicalUserProfileAssignedUserRoles + .Select(ur => new UserRoleInformationTransferData( + ur.UserRole!.Id, + ur.UserRole.UserRoleText, + externalUserRoles.Contains(ur.UserRoleId))))))) + .SingleOrDefaultAsync(); } diff --git a/tests/portalbackend/PortalBackend.DBAccess.Tests/TechnicalUserProfileRepositoryTests.cs b/tests/portalbackend/PortalBackend.DBAccess.Tests/TechnicalUserProfileRepositoryTests.cs index 02db20c197..cfa7d504c2 100644 --- a/tests/portalbackend/PortalBackend.DBAccess.Tests/TechnicalUserProfileRepositoryTests.cs +++ b/tests/portalbackend/PortalBackend.DBAccess.Tests/TechnicalUserProfileRepositoryTests.cs @@ -18,7 +18,6 @@ ********************************************************************************/ using Microsoft.EntityFrameworkCore; -using Org.Eclipse.TractusX.Portal.Backend.Framework.Models.Configuration; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Repositories; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Tests.Setup; using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities;