mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 04:20:55 +00:00
27 lines
646 B
C#
27 lines
646 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using CartriX.Shared.Models;
|
|
|
|
namespace CartriX.Api.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("api/Printer")]
|
|
public class PrinterController : ControllerBase
|
|
{
|
|
private readonly AppDbContext _context;
|
|
|
|
public PrinterController(AppDbContext context)
|
|
{
|
|
_context = context;
|
|
}
|
|
[HttpGet("{id}")]
|
|
public ActionResult GetPrinter(int id)
|
|
{
|
|
Printer printer = _context.Printers.Find(id)!;
|
|
if (printer == null)
|
|
{
|
|
return NotFound();
|
|
}
|
|
return Ok(printer);
|
|
}
|
|
}
|
|
} |