mirror of
https://gitlab.com/Hukuta47/cartrix.git
synced 2026-12-05 04:20:55 +00:00
28 lines
760 B
C#
28 lines
760 B
C#
using CartriX.Api.Services;
|
|
using CartriX.Shared.Classes;
|
|
using CartriX.Shared.Mappers;
|
|
using CartriX.Shared.Models;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace CartriX.Api.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("api/[controller]")]
|
|
public class LocationController : ControllerBase
|
|
{
|
|
private readonly LocationService _locationService;
|
|
public LocationController(LocationService locationService)
|
|
{
|
|
_locationService = locationService;
|
|
}
|
|
|
|
[HttpGet("GetAll")]
|
|
public IActionResult GetListLocations()
|
|
{
|
|
var result = _locationService.GetAll().Result.Select(l => l.OnlyNameAndPrinters());
|
|
|
|
return Ok(result);
|
|
}
|
|
}
|
|
} |