public async Task UpdateDecision(AppProtocol closedProtocol) { var decisions = _limsExchangeService.DataService.GetEntity <AppDecision>(p => p.ProtocolId == closedProtocol.Id).ToList(); foreach (var decision in decisions) { if (decision.DecisionType == "Accepted") { CreateLicenseFromApplication(decision, closedProtocol); } else { decision.IsClosed = true; var app = _limsExchangeService.DataService .GetEntity <PrlApplication>(p => p.Id == decision.AppId).SingleOrDefault(); app.AppState = "Reviewed"; app.BackOfficeAppState = "Reviewed"; _limsExchangeService.DataService.SaveChanges(); } _limsExchangeService.CloseApplication(decision.AppId); } }