This repository is a .NET library (distributed as NuGet packages) that adds a second-level query cache to Entity Framework Core applications. In production, it registers a DbCommandInterceptor that intercepts every EF Core database command: SELECT queries are converted into a cache key by hashing the SQL text, parameters, and connection string; on a cache hit, the stored result set is replayed through a custom DbDataReader implementation so EF Core never touches the database; on a miss, the query executes normally and the result is serialized into a row/column format for storage. Cache invalidation is automatic — when SaveChanges/SaveChangesAsync runs, the interceptor parses the SQL to identify affected tables and evicts all cache entries that depend on them. The architecture is a clean provider pattern. The core package (EFCoreSecondLevelCacheInterceptor) defines the interceptor, cache-key generation, SQL table extraction, and the IEFCacheServiceProvider abstraction, while separate companion packages implement backends: MemoryCache, StackExchange.Redis (with custom MessagePack serialization), FusionCache, .NET HybridCache, EasyCaching.Core, and CacheManager.Core. Public entry points are the AddEFSecondLevelCache() DI extension and the Cacheable()/NotCacheable() query extensions, with fluent configuration for expiration modes (absolute/sliding/never), per-query or global policies, and lock modes for concurrency. The codebase is actively maintained (last commit 2026-09-19, zero open issues, dependabot-clean), multi-targets .NET from net462/netstandard2.0 through net10.0, and enforces strict quality gates: TreatWarningsAsErrors, SonarAnalyzer, Meziantou analyzers, and heap-allocation analyzers. Test coverage is extensive — unit tests for key generation, SQL parsing, and data-reader reconstruction, plus integration tests across providers and issue-specific repro projects. Notable craftsmanship includes a hand-written XxHash64 unsafe implementation for fast key hashing, a DbDataReader reconstruction layer that transparently replays cached rows to EF Core, and a SQL table-name extraction processor driving invalidation. Primary risks are the heavy conditional compilation across 10+ target frameworks, SQL parsing heuristics that can miss edge cases (CTEs, subqueries, quoted identifiers), and reliance on third-party cache libraries — CacheManager.Core is explicitly unmaintained upstream. Bulk operations (ExecuteUpdate/ExecuteDelete) bypass the interceptor and require manual invalidation.
OpenBudgeteer is a personal budgeting application built with .NET 9.0 featuring a Blazor WebAssembly frontend and ASP.NET Core Web API backend. It implements the bucket budgeting methodology, allowing users to manage financial accounts, transactions, budget categories (buckets), automated transaction rules, recurring transactions, and financial reporting. The application supports multiple database providers (MySQL, PostgreSQL) and uses Redis for session storage and application settings. The architecture follows a layered approach with distinct data, service, presentation, and API layers. The data layer uses Entity Framework Core with a repository pattern for data access. The service layer provides business logic through generic and EF Core-specific services. The presentation layer employs the MVVM pattern with Blazor components and ViewModels handling UI state and logic. The API layer exposes RESTful endpoints for the frontend to interact with the backend. Key reusable components include a generic repository pattern, a generic service pattern, a ViewModel base class for Blazor, a fluent CSV bank transaction mapper, and a MudBlazor theme persistence service. These components demonstrate craftsmanship in abstraction and separation of concerns, making them suitable for extraction and reuse in other projects. The application is actively maintained with recent updates to .NET 9.0, MudBlazor, and ApexCharts, indicating low technical drift.
This repository provides a .NET library for performing high-performance bulk operations (insert, update, delete, merge, match) with Entity Framework Core and SQL Server. It extends DbContext with extension methods that leverage SqlBulkCopy and temporary tables to minimize database round-trips when processing large datasets. The library supports synchronous and asynchronous APIs, handles complex EF Core features (owned types, complex types, JSON properties, discriminators), and includes a fluent builder pattern for configuring operations. The architecture centers around extension methods for DbContext and a ConnectionContext abstraction for lower-level SQL operations. Key internal components include a property access cache for performance, sequential GUID generation for index-friendly keys, and a table mapping system to customize entity-to-table mappings. The library implements bulk operations by creating temporary tables, using SqlBulkCopy for efficient data loading, and then executing set-based SQL operations (INSERT, UPDATE, DELETE, MERGE) to synchronize with the target tables. Notable reusable components include the PropertiesCache, which compiles and caches property accessors to eliminate reflection overhead, and the SequentialGuidGenerator, which creates database-optimized GUIDs. The library is actively maintained, targets recent .NET versions, and includes a comprehensive test suite and benchmark projects validating performance improvements over standard EF Core operations.
This repository is a comprehensive educational course titled '.NET Web API Zero to Hero' by codewithmukesh. It contains over 50 independent ASP.NET Core Web API sample projects organized into modules covering fundamentals (minimal APIs, exception handling, logging), database management with EF Core (CRUD, migrations, interceptors, soft deletes, bulk operations, pagination), advanced API patterns (CQRS with MediatR, custom dispatcher, Result pattern, mapping benchmarks), performance and caching (in-memory, Redis, HybridCache, EF second-level cache), API security (JWT, refresh tokens, role/claims/policy/permission-based authorization, API keys, CORS, rate limiting), file handling (PDF invoice generation), architecture (Clean Architecture vs Vertical Slice), observability (health checks, structured logging), and background processing. Each sample is a self-contained, runnable project with minimal setup (often using in-memory databases) and includes extensive BenchmarkDotNet performance comparisons. The code is well-structured, follows modern .NET 10 patterns, and demonstrates production-quality implementations of cross-cutting concerns like global exception handling, validation pipelines, and caching strategies. While the repo is primarily a teaching resource, many components (custom CQRS dispatcher, Result pattern, EF Core interceptors, permission-based authorization) are genuinely reusable in other projects.
This repository implements a banking system built with ASP.NET Core that enables users to create bank accounts, manage cards, transfer funds internally and between banks via a central API, and process payments. The system features a modular architecture with separate projects for the main bank web application, central API for inter-bank communication, and a demo shop showcasing payment integrations. Key capabilities include user authentication with 2FA, email notifications via SendGrid, security measures like reCAPTCHA and request encryption, and role-based administration. The solution follows layered architecture patterns with separation of concerns between presentation, service, and data access layers, utilizing Entity Framework Core for ORM and AutoMapper for DTO mapping.