If service not exist in databse the not added in mapping
This commit is contained in:
parent
3884c74d9b
commit
aa596b736d
@ -364,6 +364,11 @@ namespace Marco.Pms.Services.Controllers
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
var isServiceExist = await _context.ServiceMasters.AnyAsync(s => s.Id == serviceId);
|
||||||
|
if (!isServiceExist)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var projectService = projectServices.FirstOrDefault(ps => ps.ServiceId == serviceId);
|
var projectService = projectServices.FirstOrDefault(ps => ps.ServiceId == serviceId);
|
||||||
if (projectService == null)
|
if (projectService == null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user