Never Return Your EF Entities From an API
Returning EF Core entities directly from your endpoints leaks internal structure, creates circular references, and exposes sensitive data. Use response records instead.
Returning EF Core entities directly from your endpoints leaks internal structure, creates circular references, and exposes sensitive data. Use response records instead.
Granit ships 100+ NuGet packages with zero circular dependencies, enforced by Kahn’s algorithm at startup and architecture tests at build time.
Build a complete CRUD module with Granit in under 10 minutes — from entity definition to validated endpoints with full audit trail and soft delete.
Granit is an open-source modular framework for .NET 10 — 100+ packages, zero circular dependencies, GDPR and ISO 27001 compliance built in. Here is why we built it and what it gives you.
Manual null checks are noisy and inconsistent. .NET provides built-in guard methods that are cleaner, faster, and throw the right exceptions every time.
GDPR compliance is not a checkbox. It is an architectural constraint that must be enforced at the framework level. Here is how Granit implements data minimization, right to erasure, and pseudonymization by default.
new Regex(…, RegexOptions.Compiled) allocates at startup and hides patterns from the JIT. Source-generated regex is faster, safer, and enforced at build time.
Shared DbContexts create hidden coupling between modules. Here is how Granit enforces database isolation per module — and why it makes microservice extraction mechanical.
DateTime.Now makes your code untestable and timezone-fragile. Here is how to replace it with TimeProvider and IClock for deterministic, test-friendly time.
Microservices are not a goal. They are a trade-off. Here is why Granit bets on the modular monolith as the default architecture — and how the framework makes extraction painless when the time comes.