Files
mixtape/zero.Debug/Controllers/TestController.cs
T

38 lines
889 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Mvc;
2020-05-21 23:44:43 +02:00
using System.Collections.Generic;
using System.Threading.Tasks;
using zero.Core.Api;
using zero.Core.Entities;
namespace zero.Debug.Controllers
{
public class TestController : Controller
{
IAppScope<ITranslationsApi> Api;
ITranslationsApi CurrentApi;
2020-05-21 23:44:43 +02:00
public TestController(IAppScope<ITranslationsApi> api, ITranslationsApi currentApi)
2020-05-21 23:44:43 +02:00
{
Api = api;
CurrentApi = currentApi;
2020-05-21 23:44:43 +02:00
}
[HttpGet]
public async Task<IActionResult> Index()
{
IList<Translation> global = await Api.Global.GetAll();
IList<Translation> current = await CurrentApi.GetAll();
IList<Translation> appTwo = await Api.App("applications.2-A").GetAll();
IList<Translation> shared = await Api.Shared.GetAll();
2020-05-21 23:44:43 +02:00
return Json(new {
current,
global,
appTwo,
shared
2020-05-21 23:44:43 +02:00
});
}
}
}