public List<CategoryModel> All()
{
var categorySections = this.Configuration.GetSection("Categories").GetChildren();
List<CategoryModel> categoryList = new List<CategoryModel>();
foreach (var section in categorySections)
{
var category = new CategoryModel
{
Key = section["Key"],
Name = section["Name"]
};
categoryList.Add(category);
}
return categoryList;
}