From 395d164c92949d0ce7dac888ebd3855ed3814bdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?=
 <nikita.grigorevich@gmail.com>
Date: Wed, 20 Oct 2021 17:56:36 +0500
Subject: [PATCH] Refactor WellService.GetAsync()

---
 AsbCloudInfrastructure/Services/WellService.cs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs
index cd194caa..4352c660 100644
--- a/AsbCloudInfrastructure/Services/WellService.cs
+++ b/AsbCloudInfrastructure/Services/WellService.cs
@@ -96,12 +96,12 @@ namespace AsbCloudInfrastructure.Services
                 .ThenInclude(c => c.Deposit)
                 .FirstOrDefaultAsync(w => w.Id == idWell, token)
                 .ConfigureAwait(false);
-            
+
+            if (entity is null) 
+                return null;
+
             var dto = entity.Adapt<WellDto>();
 
-            if (dto is null) 
-                return dto;
-            
             dto.Cluster = entity.Cluster?.Caption;
             dto.Deposit = entity.Cluster?.Deposit?.Caption;