using System.Reflection; using System.Text.Json; namespace Managing.Core; public static class FileHelpers { public static T ReadJson(string path) { string assemblyLocation = Assembly.GetExecutingAssembly().Location; string assemblyDirectory = Path.GetDirectoryName(assemblyLocation); if (assemblyDirectory != null) { var pathToReadFrom = Path.Combine(assemblyDirectory, path); // Reads the content of the JSON file. var json = File.ReadAllText(pathToReadFrom); return JsonSerializer.Deserialize(json); } return default; } }