From 3bc209839ea1c1a21aa42f460b502828683162cb Mon Sep 17 00:00:00 2001 From: alireza Date: Tue, 9 Jun 2026 23:50:13 +0330 Subject: [PATCH] refactor: extract DateTime.Now conversion to variable for reuse --- Complex.Application/Services/DashboardService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Complex.Application/Services/DashboardService.cs b/Complex.Application/Services/DashboardService.cs index 0174a76..9ae26dd 100644 --- a/Complex.Application/Services/DashboardService.cs +++ b/Complex.Application/Services/DashboardService.cs @@ -28,8 +28,9 @@ namespace Complex.Application.Services.Dashboard var ownerUnits = units.Count(u => u.OwnerId != null); var tenantUnits = units.Count(u => u.TenantId != null); + var today = DateOnly.FromDateTime(DateTime.Now); var activeCostCycles = _complexDBContext.CostCycles - .Count(c => c.ComplexId == complexId && c.EndDate >= DateOnly.FromDateTime(DateTime.Now)); + .Count(c => c.ComplexId == complexId && c.EndDate >= today); var unitPersonMobileNumbers = units .Where(u => u.OwnerId != null || u.TenantId != null)