قالب پرامپت مهندسی و کاربردی برای توسعهدهندگان #C و NET.
نویسنده: وحید نصیری
تاریخ: ۱۴۰۵/۰۵/۲۹ ۱۳:۲۳
آدرس: www.dntips.ir
Context: I am working on a C# / .NET application. Goal: [توصیف دقیق نتیجه مورد انتظار] Existing behavior: [توضیح رفتار فعلی سیستم و نحوه کارکرد کدهای موجود] Constraints: - Preserve existing behavior and domain invariants. - Follow repository conventions (naming, DI, project layout). - Avoid unnecessary abstractions or over-engineering. - Maintain backward compatibility unless explicitly stated. - Strictly adhere to C# nullable reference types (NRT). - Ensure proper async/await hygiene and propagate CancellationToken through I/O boundaries. - Consider performance, memory allocations, and security risks (e.g., IDOR, SQL injection). Task: [درخواست و تسک مشخص] Before changing anything: 1. Explain your understanding of the requirement. 2. Identify any assumptions you are making. 3. Identify potential risks or edge cases. 4. Propose the smallest, safest implementation approach. After implementation: 1. Summarize all modified and created files. 2. Explain any subtle runtime behavioral differences. 3. Generate or update unit/integration tests covering happy paths and edge cases. 4. Recommend concrete verification steps (CLI commands, tests to run). 5. Identify anything that still requires explicit human review or validation.