Instruction file imported from gdosiadis/market-news-app-dotnet (
.github/instructions/dotnet.instructions.md). Copyright stays with the author.
.NET / C# Guidelines
- Target framework is .NET 8 with nullable reference types enabled — respect
?annotations, don't silently introduce nulls without updating signatures. - This is a top-level statements program (
Program.cs); keep new orchestration logic there and business logic inServices/. - All I/O (scraping, AI calls, email, file cache) is
async/awaitend-to-end — never block with.Result/.Wait()on aTask. - Playwright calls (
Services/Scraper.cs) must be defensive: wrap per-element/per-site operations intry/catchso one selector or one site failing doesn't abort the whole scrape — this mirrors the existing pattern of returning partial results with a status per source rather than throwing. - When adding a new scraped site, follow the existing
SiteConfigpattern (selectors, optionalFollowFirstLinkSelectorfor list-style pages) instead of one-off scraping logic inProgram.cs. - Prefer extending the existing cache-hash mechanism (
ScrapeCache.cs/SummaryCache.cs) over adding a second, parallel caching scheme.