Skip to content

Commit

Permalink
fix review findings
Browse files Browse the repository at this point in the history
  • Loading branch information
ntruchsess committed Nov 20, 2024
1 parent 816d2a5 commit c649d4d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 17 deletions.
8 changes: 2 additions & 6 deletions src/externalsystems/Bpdm.Library/BpdmService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,10 @@ public async Task<bool> SetCxMembership(string businessPartnerNumber, Cancellati
// But BaseAddress of Business Partner Pool is different as its deployed on another server.
httpClient.BaseAddress = new Uri(_settings.BusinessPartnerPoolBaseAddress);

var requestData = new BpdmCxMembership(
new BpdmCxMembershipDto[]{
new(businessPartnerNumber, true)
}.AsEnumerable()
);
var requestData = new BpdmCxMembership([new(businessPartnerNumber, true)]);

async ValueTask<(bool, string?)> CreateErrorMessage(HttpResponseMessage errorResponse) =>
(false, (await errorResponse.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None)));
(false, await errorResponse.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None));

await httpClient.PutAsJsonAsync("v6/cx-memberships", requestData, Options, cancellationToken)
.CatchingIntoServiceExceptionFor("bpdm-put-cx-membership", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE, CreateErrorMessage).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
// <auto-generated />
using System;
using System.Text.Json;
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities;
using System.Text.Json;

#nullable disable

Expand Down

0 comments on commit c649d4d

Please sign in to comment.