public IActionResult GetAllFinOpsByOrganizationId(int orgId) { if (orgId <= 0) { BadRequest(); } return(Ok(_service.GetAllFinOpsByOrgId(orgId))); }
private void CheckInFinOps(List <TargetViewModel> targets) { try { var finOps = _finOpService.GetAllFinOpsByOrgId(targets[0].OrganizationId).ToList(); foreach (var target in targets) { if (finOps.Exists(f => f.TargetId == target.TargetId)) { target.IsDeletable = false; } } } catch (Exception e) { throw new BusinessLogicException(ErrorMessages.CantFindDataById, e); } }