Creating an Emoji Middleware Component
With the rise of emoticons…sorry, emojis…in the 2000s, a number of legacy websites use the old-style of text-based emoticons instead of the more modern emojis. Legacy Content Management Systems (CMSs) must have a lot of these text-based characters in their content. To update a website’s content to replace all of these emoticons with proper emojis sounds extremely time-consuming.
In this section, we’ll apply our standards in creating an emoji Middleware component where, if it detects a text-based emoticon, it’ll convert it to a more modern emoji.
Encapsulating the Middleware
With this new Middleware component, we want to create it in its own class in EmojiMiddleware.cs
.
Here is the first draft of our component:
public class EmojiMiddleware { private readonly ILogger _logger; private readonly RequestDelegate _next; public EmojiMiddleware...