diff --git a/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs b/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs index 51824f6..e43240b 100644 --- a/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs +++ b/Valghalla.Internal.Infrastructure/Modules/Administration/WorkLocation/WorkLocationCommandRepository.cs @@ -99,7 +99,7 @@ public async Task CreateWorkLocationAsync(CreateWorkLocationCommand comman var deletedWorkLocationResponsiblesIds = deletedWorkLocationResponsibles.Select(t => t.ParticipantId).ToList(); var newWorkLocationResponsibleIds = command.ResponsibleIds.Where(r => !existingWorkLocationResponsibles.Any(i => i.ParticipantId == r)).ToList(); - var deletedAssociatedTasks = await tasks.Where(t => t.WorkLocationId != command.Id && (deletedWorkLocationTaskTypeIds.Contains(t.TaskTypeId) || deletedWorkLocationTeamsIds.Contains(t.TeamId))).ToListAsync(); + var deletedAssociatedTasks = await tasks.Where(t => t.WorkLocationId == command.Id && (deletedWorkLocationTaskTypeIds.Contains(t.TaskTypeId) || deletedWorkLocationTeamsIds.Contains(t.TeamId))).ToListAsync(cancellationToken); foreach (var deletedWorkLocationTaskType in deletedWorkLocationTaskTypes) {