示例#1
0
        public async Task <IHttpActionResult> Get(string sortOrder, string search, int?page = 1, int?pageSize = 10)
        {
            int pageSize2 = pageSize ?? 10;

            if (pageSize2 > 40)
            {
                pageSize2 = 40;
            }
            int         pageNo   = (page ?? 1);
            Page <Bike> bikeList = await _bikeService.GetBikes(sortOrder, search, new PageParams()
            {
                PageNo = pageNo, PageSize = pageSize2
            });

            return(base.Ok(bikeList));
        }
示例#2
0
 public void GetBikes_Calls_GetAll_In_Repo()
 {
     bikeService.GetBikes();
     mockRepo.Verify(r => r.GetAll(), Times.Once);
 }
示例#3
0
 public IActionResult GetBikes()
 {
     return(Ok(_bikeService.GetBikes()));
 }
示例#4
0
        public IActionResult Get()
        {
            var result = _bikeService.GetBikes();

            return(Ok(result));
        }
示例#5
0
 public void GetBikesTest()
 {
     _bikeService.AddBike("1", 0.2m);
     Assert.AreEqual(1, _bikeService.GetBikes().Count);
 }
示例#6
0
 public IActionResult GetBikes()
 {
     return(Ok(_mapper.Map <IEnumerable <BikeIndexResource> >(_bikeService.GetBikes())));
 }