From eed97d31c61eed42b98627a02e1c2934deaaa39d Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Wed, 19 Nov 2025 10:52:16 +0530 Subject: [PATCH] Searching project through short name as well --- Marco.Pms.Services/Service/ProjectServices.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marco.Pms.Services/Service/ProjectServices.cs b/Marco.Pms.Services/Service/ProjectServices.cs index 6321714..7689898 100644 --- a/Marco.Pms.Services/Service/ProjectServices.cs +++ b/Marco.Pms.Services/Service/ProjectServices.cs @@ -52,7 +52,8 @@ namespace Marco.Pms.Services.Service _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); } - #region =================================================================== Project Get APIs =================================================================== + #region =================================================================== Project Get APIs ===================================================================\ + /// /// Retrieves a combined list of basic infrastructure and active service projects accessible by the logged-in employee within a tenant. /// @@ -84,7 +85,8 @@ namespace Marco.Pms.Services.Service { var normalized = searchString.Trim().ToLowerInvariant(); infraProjectsQuery = infraProjectsQuery - .Where(p => p.Name.ToLower().Contains(normalized)); + .Where(p => p.Name.ToLower().Contains(normalized) || + (!string.IsNullOrWhiteSpace(p.ShortName) && p.ShortName.ToLower().Contains(normalized))); } var infraProjects = await infraProjectsQuery.ToListAsync(); @@ -102,7 +104,8 @@ namespace Marco.Pms.Services.Service { var normalized = searchString.Trim().ToLowerInvariant(); serviceProjectsQuery = serviceProjectsQuery - .Where(sp => sp.Name.ToLower().Contains(normalized)); + .Where(sp => sp.Name.ToLower().Contains(normalized) || + (!string.IsNullOrWhiteSpace(sp.ShortName) && sp.ShortName.ToLower().Contains(normalized))); } var serviceProjects = await serviceProjectsQuery.ToListAsync(); @@ -127,7 +130,6 @@ namespace Marco.Pms.Services.Service return ApiResponse.ErrorResponse("Internal Server Error", "An error occurred while fetching projects.", 500); } } - public async Task> GetAllProjectsBasicAsync(bool provideAll, Employee loggedInEmployee, Guid tenantId) { try