Skip to content

Commit

Permalink
#31: modify query to check if request should be closed
Browse files Browse the repository at this point in the history
  • Loading branch information
sventhiel committed Jun 27, 2018
1 parent bc8bfb5 commit 7c89370
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ public void Accept(long decisionId, string reason)
decisionRepository.Merge(decision);
var mergedDecision = decisionRepository.Get(decision.Id);
decisionRepository.Put(mergedDecision);
uow.Commit();


if (decisionRepository.Query(m => m.Request.Id == decision.Request.Id)
if (decisionRepository.Query(m => m.Request.Id == decision.Request.Id).ToList()
.All(m => m.Status != DecisionStatus.Open))
{
var request = requestRepository.Get(decision.Request.Id);
Expand All @@ -75,10 +73,12 @@ public void Accept(long decisionId, string reason)
requestRepository.Merge(request);
var mergedRequest = requestRepository.Get(request.Id);
requestRepository.Put(mergedRequest);
uow.Commit();

}
}
}

uow.Commit();
}
}

Expand Down

0 comments on commit 7c89370

Please sign in to comment.