Files
myoffice/MyOffice.Web/Controllers/GeneralController.cs
T
2023-06-17 14:16:09 +03:00

31 lines
620 B
C#

namespace MyOffice.Web.Controllers;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Data.Repositories.Currency;
using Models.Currency;
using Services.Currency;
[Authorize]
[ApiController]
[Route("api/[controller]")]
public class GeneralController : BaseApiController
{
private readonly CurrencyService _currencyService;
public GeneralController(
CurrencyService currencyService
)
{
_currencyService = currencyService;
}
[HttpGet("~/api/general/currencies")]
public object Get()
{
var list = _currencyService.GetGlobalAll();
return list.Select(x => x.ToModel());
}
}