Exemplo n.º 1
0
        public static IList <string> TestGetResultWithEngineNames(int raceNumber, IEredmenyRepository eRepo, ICsapatRepository csRepo, IVersenyzoRepository vRepo)
        {
            EredmenyLogic  eredmenyRepo = new EredmenyLogic(eRepo);
            CsapatLogic    csapatLogic  = new CsapatLogic(csRepo);
            VersenyzoLogic vLogic       = new VersenyzoLogic(vRepo);
            var            query        = from x in eredmenyRepo.GetAllEredmeny()
                                          where x.versenyhetvege_szam == raceNumber
                                          join y in vLogic.GetAllVersenyzo() on x.rajtszam equals y.rajtszam
                                          join z in csapatLogic.GetAllCsapat() on y.csapat_nev equals z.csapat_nev
                                          orderby x.helyezes
                                          select z.motor;

            return(query.ToList());
        }
Exemplo n.º 2
0
        public static string TestGetTeamWithMostPoints(IVersenyzoRepository vRepo, ICsapatRepository csRepo)
        {
            VersenyzoLogic verLogic = new VersenyzoLogic(vRepo);
            CsapatLogic    csLogic  = new CsapatLogic(csRepo);
            var            query    = from x in verLogic.GetAllVersenyzo()
                                      orderby x.ossz_pont descending
                                      join y in csLogic.GetAllCsapat() on x.csapat_nev equals y.csapat_nev
                                      group x by y.csapat_nev into g
                                      select new
            {
                CsapatNev = g.Key,
            };

            return(query.First().CsapatNev.ToString());
        }