Posts

Azure AI and ASP.NET Core: Building an AI-Powered Language Translator with Azure Translator Service, and GPT-4o

Image
In this article, we will build a complete ASP.NET Core 9 Razor View (MVC) application that accepts text or document files (.txt, .doc, .docx), auto-detects the source language using Azure AI Translator Service , lets the user choose a target language, and performs a meaningful, context-aware translation using Azure OpenAI GPT-4o . The application also features a real-time progress bar powered by SignalR that shows actual server-side step progression. What is Azure Translator Service? Azure Translator Service (part of Azure AI Services, formerly Cognitive Services) is a cloud-based Neural Machine Translation (NMT) service provided by Microsoft. It enables developers to add multi-language translation capabilities to their applications through a simple REST API or SDK. It offers the following core capabilities: Text Translation: Translate text between 100+ languages and dialects in real-time. Language Detection: Automatically detect the language of any input te...

Using Scrutor for Dependency Injection in ASP.NET Core API Applications

Image
What is Scrutor? Scrutor is a NuGet package that extends the built-in Dependency Injection (DI) container of ASP.NET Core with assembly scanning and decoration capabilities. While ASP.NET Core provides a simple and effective DI container out of the box, it requires every service to be registered manually — one line of code per interface-to-implementation mapping. In large enterprise applications with dozens or hundreds of services, this manual registration becomes repetitive, error-prone, and difficult to maintain. Scrutor solves this problem by allowing developers to scan assemblies at startup and automatically discover and register all concrete classes that implement specific interfaces. Instead of writing individual AddScoped , AddTransient , or AddSingleton lines for each service, Scrutor enables a single builder.Services.Scan() call that handles all registrations from one or more assemblies. Scrutor vs. Built-in ASP.NET Core DI Aspect ...

Building an Employee CRUD Application with React and TanStack Query

Image
Introduction Managing server state in a React application can quickly become complex. You need to handle loading indicators, error states, caching, background refetching, and cache invalidation after mutations. TanStack Query (formerly React Query) solves all of these problems with a declarative, hook-based API. In this article, we will walk through a complete Employee CRUD application that demonstrates how to: Read a list of employees and individual employee details using useQuery . Create a new employee using useMutation and navigate to the new record. Update an existing employee and refresh the cache automatically. Delete an employee and remove it from the cache. The project is built with React 19 , TypeScript , Vite , React Router v7 , React Hook Form , and Zod for schema validation. Application Architecture The diagram below illustrates how TanStack Query sits between the React UI and the backend APIs. Read operations flow through useQuer...