August 6th, 2025
likecelebrate3 reactions

5 Copilot Chat Prompts .NET Devs Should Steal Today

Wendy Breiding (SHE/HER)
Senior Manager, Product Management

Artificial intelligence is quickly becoming a key part of the modern .NET developer’s toolkit. With GitHub Copilot Chat, you can save countless hours, eliminate friction, and unlock new levels of creativity by simply asking the right questions. But what exactly should you ask? Here are five GitHub Copilot Chat prompts every .NET dev should be using right now!

1. “Explain this code and suggest optimizations.”

When you inherit a legacy project or revisit old code, understanding what’s going on can be daunting. Add the files for your C# code into Copilot Chat and ask for not only an explanation but also recommendations for performance, readability, or maintainability improvements. You’ll save time and might learn a new trick or two!

2. “Write unit tests for this method/class.”

Testing is essential but often overlooked when deadlines loom. Put your cursor in the method or class and let Copilot Chat generate robust unit tests using xUnit, MSTest, or NUnit. It’s a great way to ensure coverage and catch edge cases you might have missed.

3. “Convert this code to use async/await.”

Modern .NET apps should leverage asynchronous programming for scalability and responsiveness. If you’ve got synchronous code, ask Copilot Chat to rewrite it with async/await patterns. This helps future-proof your codebase and enhances user experience.

4. “Find and fix potential security issues in this snippet.”

Security is everyone’s responsibility, but it can be tough to spot every vulnerability. Ask Copilot Chat to review your code for common security pitfalls like SQL injection, XSS, or improper input validation. Let AI be your extra set of eyes before pushing to production.

5. “Generate sample data or mock objects for this model.”

Whether you’re prototyping an API or writing tests, realistic data is crucial. Copilot Chat can instantly generate mock data or objects for any model, helping you simulate real-world scenarios and get your app off the ground faster.

Conclusion

These prompts are just the beginning! Experiment with Copilot Chat, adapt these ideas, and create your own shortcuts. With the right questions, you can make AI your coding sidekick and take your .NET development to the next level. Check out even more great prompts at the Awesome GitHub Copilot Customizations repo.

What prompts are you using with Copilot Chat? Share your favorites in the comments below!

Author

Wendy Breiding (SHE/HER)
Senior Manager, Product Management

1 comment

Sort by :
  • huiyuanai709 7 hours ago · Edited

    Add “Please” first 😄