Пример #1
0
        public IActionResult Get(int index, int count = 10)
        {
            var items  = db.ListVehicles().Skip(index).Take(count);
            var total  = db.CountVehicles();
            var result = new {
                _links = Paginate("/api/vehicles", index, count, total),
                total,
                index,
                count,
                items = items.Select(v => v.ToResource())
            };

            return(Ok(result));
        }
Пример #2
0
        public IActionResult Index()
        {
            var vehicles = db.ListVehicles();

            return(View(vehicles));
        }
 public IEnumerable <Vehicle> Get()
 {
     return(db.ListVehicles());
 }