testade calibre
This commit is contained in:
23
Server/Controllers/CalibreController.cs
Normal file
23
Server/Controllers/CalibreController.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Bibblan.Business.Services;
|
||||
using Bibblan.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bibblan.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class CalibreController : ControllerBase
|
||||
{
|
||||
CalibreService service;
|
||||
public CalibreController(CalibreContext db) {
|
||||
service = new CalibreService(db);
|
||||
}
|
||||
|
||||
[HttpGet("books")]
|
||||
public IActionResult GetBooks()
|
||||
{
|
||||
var books = service.GetAllBooks().Take(100).ToList();
|
||||
return Ok(books);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user