예제 #1
0
파일: Program.cs 프로젝트: mario3ster/hs
        private static ItemsList <Boat> InitBoats()
        {
            var boats = context.GetEntities <Boat>();
            var pager = new DefaultPager(3, boats.Count());

            //var boatsList = new ItemsList<Boat>(boats, filters, boatsSorters);
            var boatsList = new ItemsList <Boat>(boats, pager);

            var filters = new List <IFilter <Boat> >()
            {
                new CabinsFilter(5),
                new HullTypeFilter(HullType.Mono)
            };

            var boatsSorters = new List <ISortModifier <Boat> >()
            {
                new SortByCabinsNum()
            };

            return(boatsList);
        }
예제 #2
0
파일: Program.cs 프로젝트: mario3ster/hs
        private static ItemsList <Skipper> InitSkippers()
        {
            var skippers = context.GetEntities <Skipper>();
            var pager    = new DefaultPager(4, skippers.Count());

            var skippersSorters = new List <ISortModifier <Skipper> >()
            {
                new SortByExperience()
                {
                    Asc = true
                },
                new SortByPrice()
                {
                    Asc = false
                }
            };


            var skipperList = new ItemsList <Skipper>(skippers, pager, null, skippersSorters);

            return(skipperList);
        }