{
  "id": 15421281,
  "title": "This week in Cursor + .NET — 7 rules (week ending October 18, 2026)",
  "url": "https://urgent.news/2026/10/18/this-week-in-cursor-net-7-rules-week-ending-october-18-2026",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-18T14:01:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/agentic_architect/this-week-in-cursor-net-7-rules-week-ending-october-18-2026-3apa"
  },
  "original_language": "en",
  "account": "On Monday, October 12, 2026, senior C#/.NET engineers were reminded that Controllers should not contain database logic. All IQueryable access must remain in the Infrastructure layer to keep business logic pure and readable for the LLM.\n\nTuesday brought the importance of structured logging. Log messages must use ILogger with structured templates, steering clear of string interpolation. This ensures that when logs are fed back into Cursor for debugging, the AI can recognize the patterns instantly.\n\nWednesday reminded engineers to enforce FluentValidation rules on every MediatR Request. The AI must check the validator before writing handler logic, preventing \"context rot\" where the AI forgets business constraints.\n\nThursday saw the recommendation to use MapGroup and EndPoints for .NET 9 services. This keeps the context window lean and focused, allowing the AI to provide more accurate code suggestions compared to massive, bloated Controllers.\n\nFriday emphasized the need to inject a TimeProvider, such as IClock, instead of letting Cursor hardcode DateTime.Now or DateTime.UtcNow in business logic. This makes time deterministic for tests and stops the AI from relying on static APIs when generating time-aware code.\n\nOn Saturday, October 17, the importance of using IHttpClientFactory was highlighted. Refusing to use new HttpClient() in any generated code and forcing Cursor to inject IHttpClientFactory or a typed client prevents classic socket-exhaustion bugs that AI-generated code might unintentionally introduce.\n\nFinally, on Sunday, October 18, the rule about CancellationToken propagation was enforced. Every async method in the codebase should accept and forward a CancellationToken, preventing the AI from quietly losing cancellation half-way down a call chain.",
  "summary": "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 . 7 daily senior rules Rule 8: CancellationToken Propagation Sun 18 Oct Every async method in your codebase should accept and forward a CancellationToken. Make it a rule that any new async signature without one is flagged. Stops…",
  "key_points": [
    "Controllers should not contain database logic; keep queries in Infrastructure layer",
    "Structured logging with ILogger and templates for Cursor pattern recognition",
    "FluentValidation on every MediatR Request to prevent context rot"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}