Changed category view to rely on db collation

This commit is contained in:
Mia Rose Winter 2024-02-04 14:17:04 +01:00
parent baf39a9cd9
commit b1d3031333
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -54,11 +54,11 @@
protected override async Task OnInitializedAsync() {
await using var context = await ContextFactory.CreateDbContextAsync();
string category = WebUtility.UrlDecode(CategoryName).ToLower();
string category = WebUtility.UrlDecode(CategoryName);
await context.Set<Category>().LoadAsync();
Category = await context.Set<Category>()
.Include(c => c.Articles).ThenInclude(a => a.Author)
.Include(c => c.Articles).ThenInclude(a => a.Categories)
.FirstOrDefaultAsync(c => c.Name.ToLower() == category);
.FirstOrDefaultAsync(c => c.Name == category);
}
}