public static void SaveItems(IEnumerable<string> regionItems, IEnumerable<string> themeItems) { var toJsonObject = new MenuItemsJson (){ Region = regionItems, Theme = themeItems }; string serialized = JsonConvert.SerializeObject(toJsonObject); File.WriteAllText("menuitems.txt", serialized); }
static MenuItemsReader() { string menuItemsJson = File.ReadAllText("menuitems.txt"); _menuItems = JsonConvert.DeserializeObject<MenuItemsJson>(menuItemsJson); }