/// <summary> /// Retrieves all Category objects present in database /// </summary> /// <returns>List of List of base class object</returns> public static List <List <object> > ListAllCategories() { Console.Clear(); var api = new API(); var categoryList = api.GetCategories(); var categoryListData = CategoryConverters.CategoryConverter(categoryList); return(CategoryView.CategoryListReader(categoryListData)); }
/// <summary> /// Retrieves all Category objects based on search term matching Category.Name /// </summary> /// <returns>List of List of base class object</returns> public static List <List <object> > GetCategoriesByKeyword() { Console.Clear(); var api = new API(); Console.Write("Enter search term:"); var keyword = Console.ReadLine(); var categoryList = api.GetCategories(keyword); var categoryListData = CategoryConverters.CategoryConverter(categoryList); return(CategoryView.CategoryListReader(categoryListData)); }