{"slug": "this-week-in-cursor-net-7-rules-week-ending-august-23-2026", "title": "This week in Cursor + .NET — 7 rules (week ending August 23, 2026)", "summary": "A developer released a weekly digest of seven rules for senior C#/.NET engineers using Cursor, covering topics such as enforcing strict boundaries for database logic, using Result objects instead of nulls, adding OpenTelemetry spans, and avoiding Task.Run in controllers. The rules aim to prevent common AI-generated coding errors and improve code quality.", "body_md": "*Every weekday a single, opinionated rule for senior C#/.NET engineers using Cursor. Here's the full week in one read — canonical posts live on the Agentic Architect blog.*\n\n*Sun 23 Aug*\n\nNever let the AI write database logic in your Controllers. Enforce a strict boundary where all IQueryable access stays in the Infrastructure layer. This keeps your business logic \"pure\" and readable for the LLM.\n\n*Sat 22 Aug*\n\nStop using nulls for flow control. Use a Result object to force Cursor to handle success and failure cases explicitly. This prevents 90% of AI-generated logic errors in Web APIs.\n\n*Fri 21 Aug*\n\nLogs alone won't debug a distributed system. Add a static readonly ActivitySource per project and wrap every external call (DB, HTTP, queue) in StartActivity. Cursor never adds OTEL spans on its own — give it a rule that recognises external-call patterns and proposes the trace.\n\n*Thu 20 Aug*\n\nValueTask is a perf optimisation for hot paths that often return synchronously. It is not a drop-in for Task. Cursor swaps them around without thinking. Flag ValueTask returns and ask whether the method is actually mostly synchronous. If not, revert to Task.\n\n*Wed 19 Aug*\n\nSendEmail(string to, bool isHtml) should be SendHtmlEmail and SendPlainEmail. Bool flags hide branching that belongs in the type system. Flag any method signature with two or more bool parameters as a refactor candidate.\n\n*Tue 18 Aug*\n\nLong-running work in ASP.NET Core goes in a BackgroundService, not Task.Run inside a controller. Cursor will happily fire Task.Run and call it \"async work\" — your request thread will die mid-execution and you'll never know why. Catch Task.Run outside test code and propose a hosted service.\n\n*Mon 17 Aug*\n\nSystem.Threading.Channels beats BlockingCollection and beats roll-your-own queue plus SemaphoreSlim. The AI reaches for ConcurrentQueue every time and stitches it together by hand. A rule that detects producer/consumer patterns and proposes Channel will save you a class.\n\nThe free is one drop-in Cursor rule that ends the morning re-explanation ritual. Install in 60 seconds, see whether Cursor actually remembers your DI lifetimes, and decide for yourself whether the full kit is worth £9.00.\n\n`arch-core-lite.mdc`\n\n`arch-core-lite.mdc`\n\non GitHubCanonical home for everything in this digest: [https://agentic-architect.dev/blog/](https://agentic-architect.dev/blog/).", "url": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-23-2026", "canonical_source": "https://dev.to/agentic_architect/this-week-in-cursor-net-7-rules-week-ending-august-23-2026-40ng", "published_at": "2026-08-23 10:41:38+00:00", "updated_at": "2026-08-23 11:14:36.331313+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence"], "entities": ["Cursor", "Agentic Architect", "ASP.NET Core", "OpenTelemetry"], "alternates": {"html": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-23-2026", "markdown": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-23-2026.md", "text": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-23-2026.txt", "jsonld": "https://wpnews.pro/news/this-week-in-cursor-net-7-rules-week-ending-august-23-2026.jsonld"}}