using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using BuecherwurmAPI.Data; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using BuecherwurmAPI.Models; namespace BuecherwurmAPI.Controllers { [Route("api/leihvorgang")] [ApiController] public class LendController : ControllerBase { private readonly MockLendRepo _mockLendRepo = new MockLendRepo(); //GET api/leihvorgang/ [HttpGet] public ActionResult> GetAllLends() { var lends = _mockLendRepo.GetAllLends(); return Ok(lends); } //GET api/leihvorgang/{id} [HttpGet("{id}")] public ActionResult GetLend(int id) { var lend = _mockLendRepo.GetLendById(id); return Ok(lend); } } }