예제 #1
0
        public AthleteHealthQuery GetHealthHistory(AthleteHealthQuery query)
        {
            var healths = DataContext.Queryable<AthleteHealth>().Where(x => x.Athlete.Equals(query.Athlete));
            var pager = new Pager<AthleteHealth>(
                healths,
                query.PagingData.PageOffset,
                query.PagingData.PageSize,
                query.PagingData.RequestsLastPage);

            query.AthleteHealthHistory = pager.GetPagedItems().ToList();
            query.PagingData.TotalCount = pager.TotalCount;
            query.PagingData.PageOffset = pager.PageOffset;
            return query;
        }
예제 #2
0
        public void AssertFindsHistory()
        {
            const int pagesize = 5;
            var athleteBuilder = new AthleteBuilder();
            var athlete = athleteBuilder.Build();
            var query =
                new AthleteHealthQuery {PagingData = BuildPagingData(pagesize), Athlete = athlete};
            MemoryDataContext.Clear();

            MemoryDataContext.Add(athlete);
            InsertTestHealthHistory(athlete, pagesize*2);

            var athleteDataAccess = new AthleteDataAccess();

            query = athleteDataAccess.GetHealthHistory(query);

            Assert.AreEqual(pagesize, query.AthleteHealthHistory.Count);
            Assert.AreEqual(pagesize*2, query.PagingData.TotalCount);
        }
예제 #3
0
파일: Classes.cs 프로젝트: 1pindsvin/yagni
 public void SetAthleteHealthQuery(AthleteHealthQuery query)
 {
     throw new NotImplementedException();
 }