Categories
-
I just created a Categories list so new blogs will show a dropdown. This is so cool to see. This is what the code looks like:
Pageable<TableEntity> queryResultsFilter = GetQuery();
var blogs = new List<BlogModel>();
var categories = new List<SelectListItem>();
var keyFilter = queryResultsFilter.GroupBy(x => x.PartitionKey).Select(y => y.First());
foreach (TableEntity key in keyFilter)
{
categories.Add(new SelectListItem(key.PartitionKey, key.PartitionKey));
}
return categories;I guess I still need to work on adding colors to the blog. Basically, every time you create a new blog, the app will pull distinct values of all previous categories, so I need to allow you to enter a new one instead, otherwise you have to use the existing ones.
- Thursday, 11 September 2025 17:17
- Category
- Keywords
- Private
- Azure
- Code