Posts

Showing posts from March, 2025

ASP.NET Core 9: Localized Response from ASP.NET Core 9 API

Image
When building enterprise applications, it is highly important to support different language and localized settings. Recently, while discussing with one of my student, a point raised on the multi-lingual response management from the API applications. The need was to send the response from the API based on the local language settings sent to it in the HTTP request. One of the benefits of the ASP.NET Core is an easy support for Localization using the Middleware. The UseRequestLocalization() Middleware is used to configure the Localization options so that the API can be configured to use the Localized resource before sending the response. The RequestLocalizationOptions  class is used to set the configuration for default culture that can be changed while processing the request based on the Accept-Language header received from the HTTP Request. How the Localization is handled in ASP.NET Core Figure 1, explains the localized response processing Figure 1: The Localized Response Processing ...

Angular: Creating Dynamically Updating Chart with ng2-charts and chart.js with capacilities of Rxjs

I wrote an article on creating Real-Time Charts using SignalR and Blazor . After reading this article, some of my students were looking for the same chart in Angular, so I decided to write on this topic. In Angular, we can use JavaScript timer functions, e.g., setInterval(), to call the server side to fetch data and process it on the client side. But instead of using such a JavaScript function, we should use  RxJs  to handle time-based or time-bound operations. What is RxJs?   RxJS, or Reactive Extensions for JavaScript, is a library for composing asynchronous and event-based programs using observable sequences. RxJs provides a powerful and flexible way to handle data streams and asynchronous events that makes it easier and smarter to manage complex asynchronous tasks in JavaScript applications.      Following are some of the most important key features of RxJs: Observables: They represent data streams. These data steams can be observed and manipulate...