28 lines
856 B
C#
28 lines
856 B
C#
namespace Xylem.Common.Service.MeterProcessState.Controllers
|
|
{
|
|
using Newtonsoft.Json;
|
|
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Web.Http;
|
|
|
|
using Xylem.Common.Hardware.WaterMeter.Genesis.Registers.Json;
|
|
|
|
public class JsonConfigurationController : ApiController
|
|
{
|
|
[HttpGet]
|
|
public IHttpActionResult Get()
|
|
{
|
|
var settings = new JsonSerializerSettings
|
|
{
|
|
NullValueHandling = NullValueHandling.Ignore
|
|
};
|
|
|
|
var json = File.ReadAllText(@"C:\Users\SZLATEV\source\repos\laa_production\Common\Hardware\WaterMeter\Genesis\GenesisCore\configuration.json");
|
|
var values = JsonConvert.DeserializeObject<IDictionary<string, AppSection>>(json, settings);
|
|
|
|
return this.Json(values, settings);
|
|
}
|
|
}
|
|
}
|