From 06b3166cc74d726996cbc8cb3d57b2bdbd9937f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Vin=C3=ADcius?= Date: Sat, 18 May 2024 22:07:44 -0300 Subject: [PATCH] Refactor(Business): Removed unecessary try catch at replace data base entity metadata recover --- Business/Business/LaunchApiBusiness.cs | 32 ++++++++++---------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Business/Business/LaunchApiBusiness.cs b/Business/Business/LaunchApiBusiness.cs index c279fb0..e8b02bd 100644 --- a/Business/Business/LaunchApiBusiness.cs +++ b/Business/Business/LaunchApiBusiness.cs @@ -343,26 +343,18 @@ private async Task GenerateLog(int offset, string message, int entityCount, bool private async Task SetOriginalBaseEntityDataProcesses(Launch launch) { LaunchBaseEntityAggregate launchBaseEntityAggregate = new(); - - try - { - await Task.WhenAll( - SetOriginalBaseEntityData(launch.Status, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.LaunchServiceProvider, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.Rocket.Configuration, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.Rocket, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.Mission.Orbit, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.Mission, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.Pad.Location, launchBaseEntityAggregate), - SetOriginalBaseEntityData(launch.Pad, launchBaseEntityAggregate), - SetOriginalBaseEntityLaunchData(launch, launchBaseEntityAggregate) - ); - _mapper.Map(launchBaseEntityAggregate, launch); - } - catch - { - throw; - } + await Task.WhenAll( + SetOriginalBaseEntityData(launch.Status, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.LaunchServiceProvider, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.Rocket.Configuration, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.Rocket, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.Mission.Orbit, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.Mission, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.Pad.Location, launchBaseEntityAggregate), + SetOriginalBaseEntityData(launch.Pad, launchBaseEntityAggregate), + SetOriginalBaseEntityLaunchData(launch, launchBaseEntityAggregate) + ); + _mapper.Map(launchBaseEntityAggregate, launch); } private async Task SetOriginalBaseEntityLaunchData(Launch launch, LaunchBaseEntityAggregate aggregateData)