From aa596b736d14ef59eb49ee737dae2f7ed3579779 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Fri, 19 Sep 2025 16:56:31 +0530 Subject: [PATCH] If service not exist in databse the not added in mapping --- Marco.Pms.Services/Controllers/OrganizationController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Marco.Pms.Services/Controllers/OrganizationController.cs b/Marco.Pms.Services/Controllers/OrganizationController.cs index b20a1d7..1001646 100644 --- a/Marco.Pms.Services/Controllers/OrganizationController.cs +++ b/Marco.Pms.Services/Controllers/OrganizationController.cs @@ -364,6 +364,11 @@ namespace Marco.Pms.Services.Controllers { continue; } + var isServiceExist = await _context.ServiceMasters.AnyAsync(s => s.Id == serviceId); + if (!isServiceExist) + { + continue; + } var projectService = projectServices.FirstOrDefault(ps => ps.ServiceId == serviceId); if (projectService == null) {