Including Vector Databases in ASP.NET Core Search, such as Pinecone
Users now expect contextual retrieval, fuzzy relevance, and semantic search in addition to keyword matching….
Users now expect contextual retrieval, fuzzy relevance, and semantic search in addition to keyword matching. Vector databases offer effective similarity search and store vector embeddings (Pinecone, Milvus, Weaviate, etc.). They enable you to integrate semantic search to ASP.NET Core apps with low latency and great relevance when combined with OpenAI (or other embedding models). With…
ViewState is used in ASP.NET to maintain control data in between postbacks. However, in other situations—particularly when performance is crucial and a page is losing state information—using ViewState might not be required or desirable. This article describes how to disable ViewState in an ASP.NET project at different levels. These techniques range from turning off ViewState…
According to the RFC 7515 standard, JWS (JSON Web Signature) is a small, URL-safe technique for securely expressing claims between two parties. It allows you to digitally sign data and verify that it hasn’t been altered while being transmitted. A particular kind of message authentication code (MAC) that uses a cryptographic hash function and a…
This article explains the KISS (Keep It Simple, Stupid) principle in C# through practical, real-world examples. You’ll learn how to identify and eliminate unnecessary complexity in your code, refactor over-engineered solutions into simple, maintainable designs, and combine KISS with DRY and SOLID principles to create robust applications. Whether you’re a junior developer looking to write…
Memory management in .NET is handled by the Garbage Collector (GC), which automatically reclaims memory used by objects that are no longer needed. However, there are scenarios where you might want to manually control garbage collection or prevent unnecessary cleanup. Two commonly misunderstood methods are: GC.Collect() → Forces garbage collection. GC.SuppressFinalize() → Prevents the finalizer…
The core of ASP.NET Core is Kestrel, a lightweight, cross-platform web server designed for contemporary cloud-native applications. Kestrel powers your app in the background, regardless of whether you’re deploying it on Windows, Linux, or Docker. Let’s examine Kestrel’s definition, internal operation, deployment and configuration (using IIS or Nginx reverse proxy settings), and concluding with important…
1. Overview & Approach Security testing for ASP.NET Core should include multiple layers: Static Analysis (SAST): scan code for insecure patterns. Dependency/Package Scanning: find vulnerable NuGet packages. Configuration Review: Ensure framework and middleware settings are secure. Dynamic Testing (DAST): exercise the running app to find runtime flaws. Automated Integration Tests: programmatic tests that assert security…
Overview An Object-Relational Mapper (ORM) is frequently used by developers to link their code to the database while working with.NET applications. Entity Framework (EF) is the most widely used ORM in the.NET ecosystem. Since EF has changed over time, there are currently two primary versions: Entity Framework Core (EF Core) and Entity Framework 6 (EF6)….
Dependency injection (DI) plays a key role in managing object lifetimes and dependencies in contemporary.NET applications, particularly in ASP.NET Core and background services. Singleton and transient services are simple to comprehend, but scoped services—particularly those that are not part of the request pipeline—become more complex. This is where IServiceScopeFactory becomes crucial. This article breaks down….
A practical guide to keeping your cache fresh using SqlDependency, version stamps, and distributed invalidation patterns (MemoryCache / Redis). Table of Contents Why database-aware caching? Patterns at a glance SQL Server Query Notifications with SqlDependency Version-Stamp (Polling-Light) Strategy Event-Driven Invalidation (App-layer) Distributed Cache + Redis Pub/Sub Drop-in C# Cache Wrapper Best practices & pitfalls Why…