using CMS_CORE_Library.Models; using System.Collections.Generic; using System.Web.Http; using Thermo.Active.Model.DTOModels; using Thermo.Active.NC; using Thermo.Active.Utils; namespace Thermo.Active.Controllers.WebApi { [RoutePrefix("api/starred_softkey")] public class StarredUserSoftKeyController : ApiController { /// /// Oggetto adapter condiviso da WebAPI /// protected static NcAdapter ncAdapter = new NcAdapter(); [Route("get"), HttpGet] public IHttpActionResult GetStarredUserSoftkey() { // // Try connection CmsError libraryError = ncAdapter.Connect(); if (libraryError.IsError()) { ThermoActiveLogger.LogError($"ncAdapter Not connected! | GetOverview | {libraryError.exception}"); } libraryError = ncAdapter.GetStarredUserSoftKeys(out List softKeys); if (libraryError.IsError()) { ThermoActiveLogger.LogError($"GetStarredUserSoftkey error | {libraryError.exception}"); return BadRequest(libraryError.localizationKey); } return Ok(softKeys); } } }