Exemplo n.º 1
0
        ///<summary>פונקציה לשליפת כל הלומדים של ספר מסוים לתורם מסוים=כל הלומדים מבקשה מסוימת.</summary>
        ///<param>the id of the relevant request</param>
        ///<returns>list of the learners that are connected to this request</returns>
        public static List <Learner> GetLearnesForBookByReq(int requestId)
        {
            using (BTProjectEntities db = new BTProjectEntities())
            {
                List <Learner> allLearners = Learner.cToDTO(db.learners_tbl.ToList());

                List <int>     correntIDs = SingleLearner.GetMatchingsPerRequest(requestId);
                List <Learner> res        = new List <Learner>();
                foreach (Learner l in allLearners)
                {
                    if (correntIDs.Contains(l.learnerId))
                    {
                        res.Add(l);
                    }
                }
                return(res);
            }
        }