adamrussell.com

Adding search functionality to a site can be deceptively complex. There's a lot more than just basic string matching that goes into a decent search function -- e.g. fuzziness, stemming, synonyms, etc. Luckily, there are several software services available that provide a lot of functionality out-of-the-box. I'm currently a fan of Elasticsearch for its ease of use and feature-set.

Elasticsearch provides two .NET clients: both a low-level .NET client, Elasticsearch.net, as well as their high-level client, NEST. This post is about using NEST with ASP.NET Core.

Continue reading »

After upgrading an application from ASP.NET Core 2.2 to ASP.NET Core 3.0, I had some issues where controller methods in an application were returning populated objects, but the HTTP responses were blank Json documents: . To make matters worse, there were no exceptions thrown -- the application was just silently sending blank documents to the browser.

Continue reading »

A @section Scripts block does not work when placed in a partial view in ASP.NET Core, which is the same functionality as in ASP.NET MVC. Unfortunately, you don't get any error messages if you try to add the section to a partial -- it just does nothing. In many cases, having a scripts section in a partial view would be an anti-pattern, since the partial can be rendered an unknown number of times. However, there are times when I believe a scripts section is warranted in a partial, particularly when you're trying to create dynamic JavaScript based on the model passed into the partial view. While you can't just use the actual @section Scripts in a partial view, you can add some HTML helper extensions to accomplish the same thing.

Continue reading »
Newer Page 2 of 4 Older