diff --git a/app/Agri.CalculateService/CalculateFertigationNutrients.cs b/app/Agri.CalculateService/CalculateFertigationNutrients.cs index 11e07f2b..2e169f16 100644 --- a/app/Agri.CalculateService/CalculateFertigationNutrients.cs +++ b/app/Agri.CalculateService/CalculateFertigationNutrients.cs @@ -113,9 +113,8 @@ private Fertilizer getFertilizer(int id){ private Fertigation GetFertigationData() { - var filePath = "../../../Agri.Data/SeedData/FertigationData.json"; - var jsonData = System.IO.File.ReadAllText(filePath); - return JsonConvert.DeserializeObject(jsonData); + var jsonData = SeedDataLoader.GetSeedJsonData(Constants.SeedDataFiles.Fertigation); + return jsonData; } } } diff --git a/app/Agri.Data/Agri.Data.csproj b/app/Agri.Data/Agri.Data.csproj index f43572cb..e9badb74 100644 --- a/app/Agri.Data/Agri.Data.csproj +++ b/app/Agri.Data/Agri.Data.csproj @@ -16,6 +16,7 @@ + diff --git a/app/Agri.Data/Constants.cs b/app/Agri.Data/Constants.cs index 7fbb717a..d5e6e6d6 100644 --- a/app/Agri.Data/Constants.cs +++ b/app/Agri.Data/Constants.cs @@ -17,6 +17,7 @@ public static class SeedDataFiles public const string NutrientIcons = "Agri.Data.SeedData.NutrientIconsData.json"; public const string SubMenus = "Agri.Data.SeedData.SubMenusData.json"; public const string UserPrompts = "Agri.Data.SeedData.UserPromptsData.json"; + public const string Fertigation = "Agri.Data.SeedData.FertigationData.json"; } } } \ No newline at end of file diff --git a/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs b/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs index 70a5c2fb..12e568ac 100644 --- a/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs +++ b/app/Server/src/SERVERAPI/Controllers/NutrientsController.cs @@ -1170,9 +1170,8 @@ private void FertigationUpdate(FertigationDetailsViewModel fgvm) public Fertigation GetFertigationData() { - var filePath = "../../../Agri.Data/SeedData/FertigationData.json"; - var jsonData = System.IO.File.ReadAllText(filePath); - return JsonConvert.DeserializeObject(jsonData); + var jsonData = SeedDataLoader.GetSeedJsonData(Constants.SeedDataFiles.Fertigation); + return jsonData; } [HttpGet] diff --git a/app/Server/src/SERVERAPI/ViewComponents/CalcFertigationViewComponent.cs b/app/Server/src/SERVERAPI/ViewComponents/CalcFertigationViewComponent.cs index 31208c15..1e6ff3e0 100644 --- a/app/Server/src/SERVERAPI/ViewComponents/CalcFertigationViewComponent.cs +++ b/app/Server/src/SERVERAPI/ViewComponents/CalcFertigationViewComponent.cs @@ -72,9 +72,8 @@ private Task GetFertigationAsync(string fldName) } public Fertigation GetFertigationData() { - var filePath = "../../../Agri.Data/SeedData/FertigationData.json"; - var jsonData = System.IO.File.ReadAllText(filePath); - return JsonConvert.DeserializeObject(jsonData); + var jsonData = SeedDataLoader.GetSeedJsonData(Constants.SeedDataFiles.Fertigation); + return jsonData; } private Fertilizer GetFertigationFertilizer(int id) {