8 NDepend Rules to Enforce Domain-Driven Design in .NET
Eight NDepend CQLinq rules automate Domain-Driven Design enforcement in .NET, protecting architectural boundaries, entities, and aggregate roots.
Blog · Topic
16 articles tagged C#.
Eight NDepend CQLinq rules automate Domain-Driven Design enforcement in .NET, protecting architectural boundaries, entities, and aggregate roots.
The IL code behind the C# 14 field keyword reveals how it removes property boilerplate, and which caveats matter before refactoring an existing codebase.
Reliable resource management in C# depends on IDisposable. Implementing it correctly cleans up unmanaged resources like file handles and connections, and prevents leaks.
C# 14 adds null-conditional assignment, a feature that safely assigns values to properties or indexers without long chains of if statements.
C# 14 lets types define their own compound assignment operators, avoiding unnecessary object creation. The feature is explained along with the pitfalls to avoid.
Security-sensitive code needs true randomness. Here, .NET's RandomNumberGenerator class is used to produce cryptographically secure random values instead of Random.
C#'s null-conditional and null-coalescing operators handle null values gracefully, resulting in cleaner and more robust code. Each is explained with examples.
Extension methods let C# developers add functionality to existing classes, even sealed third-party ones, without resorting to inheritance or wrapper classes.
Three methods for converting strings into enums in C# are compared, with guidance on which approach best suits different performance and safety requirements.
Config.Net offers an interface-based way to manage settings in .NET and .NET Core applications with minimal boilerplate. A follow-up to the App.config article.
C# offers several ways to turn a DateTime into a string. Custom format specifiers give full control over the output, and each one is explained with examples.
A build error caused by the Mark of the Web can block Visual Studio projects. Several fixes are covered, from unblocking files to more obscure solutions.
A single line of code in a Nancy module enables CORS, allowing a REST API built with Nancy to be called from JavaScript hosted on other domains.
A Visual Studio extension speeds up .NET development for Sage CRM, bundling project templates, item templates, and snippets for commonly used components.
Reflection lets a C# application load DLL assemblies at runtime, extract methods from them, and execute those methods without compile-time references.
Custom configuration sections let a .NET app read structured settings from its App.config file. The classes needed to define and read them are demonstrated.