Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Category: AI

AI

AI Prompt: Refactor Legacy Code to Modern Standards

- 30.03.26 - ErcanOPAK comment on AI Prompt: Refactor Legacy Code to Modern Standards

πŸ”§ Modernize Legacy Code Fast Inherited spaghetti code from 2010? 500-line function? No tests? AI refactors to modern patterns, breaks into testable units, explains every change. The Refactoring Prompt Refactor this legacy code to modern standards: Current code: [paste legacy code] Language/Framework: [JavaScript/Python/C#/etc.] Target version: [ES2023/Python 3.11/C# 12/etc.] Requirements: 1. Break down into smaller, single-responsibility […]

Read More
AI

AI Prompt: Optimize Slow SQL Queries with AI Analysis

- 30.03.26 - ErcanOPAK comment on AI Prompt: Optimize Slow SQL Queries with AI Analysis

πŸš€ 10 Second Query β†’ 0.1 Second Slow database query killing performance? Don’t know SQL optimization? AI analyzes query, suggests indexes, rewrites for massive speedup. The Query Optimization Prompt I have a slow SQL query that needs optimization. Current query: [paste your SQL query] Database: [PostgreSQL/MySQL/SQL Server/etc.] Table sizes: – users: 1 million rows – […]

Read More
AI

AI Prompt: Use AI as Senior Code Reviewer for Pull Requests

- 30.03.26 - ErcanOPAK comment on AI Prompt: Use AI as Senior Code Reviewer for Pull Requests

πŸ‘¨β€πŸ’» AI Senior Developer at Your Service No senior dev for code review? AI can spot bugs, security issues, performance problems. Acts like experienced tech lead reviewing your code. The Code Review Prompt Act as a senior software engineer conducting a thorough code review. Review this code for: 1. Bugs and logical errors 2. Security […]

Read More
AI

AI Prompt: Learn New Technology with Personalized Curriculum

- 22.03.26 - ErcanOPAK comment on AI Prompt: Learn New Technology with Personalized Curriculum

πŸŽ“ Your Personal Tech Tutor Learning new framework? Need structured path? AI creates custom curriculum based on your level and goals. The Learning Curriculum Prompt Create a learning curriculum for: [TECHNOLOGY] My background: – Current role: [e.g., Frontend Developer] – Experience: [e.g., 3 years JavaScript, React basics] – Goal: [e.g., Build production-ready apps in 3 […]

Read More
AI

AI Prompt: Transform Data Between Formats (CSV, JSON, XML, SQL)

- 22.03.26 - ErcanOPAK comment on AI Prompt: Transform Data Between Formats (CSV, JSON, XML, SQL)

πŸ”„ Convert Any Data Format Instantly CSV to JSON? XML to SQL? Excel to API payload? AI transforms data between formats in seconds. The Universal Data Transformer Prompt Transform this data from [SOURCE FORMAT] to [TARGET FORMAT]: [Paste data] Requirements: – Preserve all data (no loss) – Use proper data types – Format for [USE […]

Read More
AI

AI Prompt: Generate Complete API Documentation from Codebase

- 22.03.26 - ErcanOPAK comment on AI Prompt: Generate Complete API Documentation from Codebase

πŸ“š Documentation in Minutes, Not Days Writing API docs manually takes forever. AI reads your code and generates complete documentation with examples. The Documentation Prompt Generate comprehensive API documentation for this codebase: [Paste controllers/routes/API code] Include: 1. Endpoint descriptions (what each does) 2. HTTP methods and paths 3. Request parameters (query, body, headers) 4. Request […]

Read More
AI

AI Prompt: Generate Complex Regex Patterns in Plain English

- 19.03.26 - ErcanOPAK comment on AI Prompt: Generate Complex Regex Patterns in Plain English

πŸ”€ Regex Without the Pain Need to validate email? Extract phone numbers? Parse log files? Describe it in English, AI writes the regex. The Regex Prompt Create a regex pattern that matches: [Describe what you want to match] Requirements: – Provide the regex pattern – Explain each part of the pattern – Give 5 examples […]

Read More
AI

AI Prompt: Generate Unit Tests with 90% Coverage Instantly

- 19.03.26 - ErcanOPAK comment on AI Prompt: Generate Unit Tests with 90% Coverage Instantly

πŸ§ͺ Write Tests 100x Faster Writing tests is tedious. AI generates comprehensive test suites in seconds. Edge cases included. The Test Generation Prompt Generate comprehensive unit tests for this code: [Paste your function/class] Requirements: – Use [Testing Framework: Jest/xUnit/pytest/etc] – Test happy path – Test edge cases (null, empty, invalid input) – Test error conditions […]

Read More
AI

AI Prompt: Get Senior-Level Code Reviews Instantly

- 19.03.26 - ErcanOPAK comment on AI Prompt: Get Senior-Level Code Reviews Instantly

πŸ‘¨β€πŸ’» Your Personal Senior Developer No senior dev on team? AI reviews your code like one. Security holes, performance issues, best practices – all caught instantly. The Ultimate Code Review Prompt Review this code as a senior developer: [Paste your code] Check for: 1. Security vulnerabilities (SQL injection, XSS, secrets in code) 2. Performance issues […]

Read More
AI

AI Prompt: Convert Figma Design to Tailwind Classes

- 19.03.26 | 19.03.26 - ErcanOPAK comment on AI Prompt: Convert Figma Design to Tailwind Classes

Designer sends Figma mockup. You need exact Tailwind classes. [Upload Figma screenshot] Convert this design to Tailwind CSS classes: Provide exact classes for: – Spacing (margin, padding) – Colors (bg, text, border) – Typography (font size, weight, line height) – Layout (flex, grid) – Responsive breakpoints Output as ready-to-use className strings. Result: Copy-paste Tailwind classes. […]

Read More
AI

AI Prompt: Explain Git Conflicts in Plain English

- 19.03.26 | 19.03.26 - ErcanOPAK comment on AI Prompt: Explain Git Conflicts in Plain English

Git conflict appears. Cryptic markers. No idea what to keep. Explain this git conflict: [Paste conflict with <<<<<<< ======= >>>>>>>] Explain in plain English: 1. What each version is trying to do 2. Which version to keep (and why) 3. How to merge them properly 4. The safe resolution I’m not a Git expert, make […]

Read More
AI

AI Prompt: Generate API Documentation from Code

- 19.03.26 | 19.03.26 - ErcanOPAK comment on AI Prompt: Generate API Documentation from Code

Wrote API. Need docs. Don’t want to write manually. Takes hours. Generate API documentation: [Paste code: controllers, models, routes] Format as OpenAPI 3.0 spec with: – Endpoint descriptions – Request/response schemas – Example requests/responses – Error codes – Authentication requirements Make it Postman/Swagger ready. Output: Complete OpenAPI YAML. Import to Swagger UI. Done. Bonus: Ask […]

Read More
AI

AI Prompt: Refactor Legacy Code with Explanations

- 19.03.26 - ErcanOPAK comment on AI Prompt: Refactor Legacy Code with Explanations

♻️ Modernize Old Code Inherited 10-year-old codebase? AI refactors + teaches you why. Refactor this legacy code: [Paste old code] Target: – Language: [Current language + latest version] – Patterns: Modern best practices – Performance: Optimize bottlenecks – Readability: Clear naming, comments For each change explain: 1. What was wrong with old approach 2. Why […]

Read More
AI

AI Prompt: Convert Screenshots to Working Code

- 19.03.26 - ErcanOPAK comment on AI Prompt: Convert Screenshots to Working Code

πŸ“Έ Design to Code in Seconds Designer sends mockup. You convert to code. Takes 2 hours. Or… 30 seconds with AI. [Upload screenshot of UI mockup] Convert this design to code: Framework: React + Tailwind CSS Requirements: – Responsive (mobile-first) – Accessible (ARIA labels) – Production-ready (no placeholders) – Match colors, spacing, typography exactly – […]

Read More
AI

AI Prompt: Generate SQL Queries from Natural Language

- 19.03.26 - ErcanOPAK comment on AI Prompt: Generate SQL Queries from Natural Language

πŸ—ƒοΈ Text to SQL Non-technical users need data. Train AI on your schema, get perfect queries. You are a SQL expert. Here’s my database schema: Tables: – Users (id, name, email, created_at) – Orders (id, user_id, total, status, created_at) – Products (id, name, price) Convert this request to SQL: “Show me top 10 customers by […]

Read More
AI

AI Prompt: The Zero-Waste Personalized Chef

- 01.03.26 - ErcanOPAK comment on AI Prompt: The Zero-Waste Personalized Chef

Stop wasting money on groceries. Let AI plan your week based on what’s already in your fridge. The Prompt: “I have these ingredients: [List them]. I want [3] meals. I have a [Type – e.g. Air Fryer/Slow Cooker]. I am [Diet – e.g. Low Carb]. Create a recipe for each, including prep time and macros. […]

Read More
AI

AI Prompt: Transforming Your Resume for ATS Mastery

- 01.03.26 - ErcanOPAK comment on AI Prompt: Transforming Your Resume for ATS Mastery

Applicant Tracking Systems (ATS) reject 70% of resumes before a human sees them. Fix yours now. “Act as a Senior HR Manager. I am applying for [Job Title]. Here is the Job Description: [Paste JD]. Here is my Resume: [Paste Resume]. Rewrite my experience section using the ‘Google XYZ Formula’ (Accomplished [X] as measured by […]

Read More
AI

AI Prompt: The ‘Ultimate Problem Solver’ Framework

- 01.03.26 - ErcanOPAK comment on AI Prompt: The ‘Ultimate Problem Solver’ Framework

🎯 The Power Prompt “I have [Problem]. Act as a world-class consultant. 1. Ask me 5 clarifying questions to define the root cause. 2. Once answered, provide 3 solutions: The Quick Fix, The Scalable Fix, and The Extreme Fix. 3. Tell me which one you’d choose and why.” This prompt forces AI to think before […]

Read More
AI

AI Prompt: Personal Growth via ‘Antifragility’ Analysis

- 01.03.26 - ErcanOPAK comment on AI Prompt: Personal Growth via ‘Antifragility’ Analysis

Based on Nassim Taleb’s concept, use AI to turn your weaknesses into strengths. The Prompt: “Act as a Stoic Philosopher and Risk Analyst. I am facing [Current Life Problem]. 1. Explain how I can apply ‘Antifragility’ hereβ€”not just surviving, but getting better because of the stress. 2. Identify the ‘fragile’ parts of my current plan. […]

Read More
AI

AI Prompt: Language-to-Language Logic Translation

- 01.03.26 - ErcanOPAK comment on AI Prompt: Language-to-Language Logic Translation

Converting code isn’t just about syntax; it’s about idiomatic patterns. “Act as a Polyglot Developer. Convert this Java Spring Boot code to C# .NET 8: [Paste Code]. Don’t just change syntax; use .NET idioms like LINQ, async/await properly, and replace Java libraries with their most robust .NET equivalents (e.g., AutoMapper, FluentValidation).”

Read More
AI

AI Prompt: The ‘Staff Engineer’ Architectural Review

- 01.03.26 - ErcanOPAK comment on AI Prompt: The ‘Staff Engineer’ Architectural Review

Use this prompt to validate your system design before writing a single line of code. The Prompt: “Act as a Staff Systems Architect. Review this proposed system: [Describe Architecture]. 1. Identify potential Single Points of Failure (SPOF). 2. Evaluate the data consistency model (Strong vs Eventual). 3. Suggest how to handle a total regional outage. […]

Read More
AI

AI Prompt: Creating a 30-Day ‘Expert’ Curriculum for Any Skill

- 01.03.26 - ErcanOPAK comment on AI Prompt: Creating a 30-Day ‘Expert’ Curriculum for Any Skill

Want to learn Quantum Physics or Woodworking? AI is your private tutor. The Prompt: “I am a beginner in [Topic]. I have 1 hour a day. Act as a Curriculum Designer. 1. Create a 4-week learning path. 2. For each week, list 3 key concepts and 1 practical project. 3. Recommend the top 3 free […]

Read More
AI

AI Prompt: Generating 100% Code Coverage Unit Tests

- 01.03.26 - ErcanOPAK comment on AI Prompt: Generating 100% Code Coverage Unit Tests

Writing tests is tedious. Let AI find the edge cases you missed. “Act as a Senior QA Engineer. For the following function: [Paste Code]. Generate a comprehensive test suite using [Framework – e.g., xUnit/Jest]. Include: 1. Happy paths. 2. Edge cases (nulls, empty, max/min). 3. Error handling verification. 4. Mock dependencies where necessary. Ensure the […]

Read More
AI

AI Prompt: Breaking Down Complex Problems with First Principles Thinking

- 01.03.26 - ErcanOPAK comment on AI Prompt: Breaking Down Complex Problems with First Principles Thinking

Elon Musk and Aristotle use it; now you can too. Stop reasoning by analogy and start from the fundamental truths. The Prompt: “I want to solve [Problem – e.g., Reducing city traffic]. Act as a Polymath. 1. Identify the ‘Fundamental Truths’ (What is absolutely true here?). 2. Deconstruct the problem into its smallest components. 3. […]

Read More
AI

AI Prompt: The Emergency Plumber – DIY Leak Management

- 28.02.26 - ErcanOPAK comment on AI Prompt: The Emergency Plumber – DIY Leak Management

Plumbing issues happen on Sundays. Use AI to stabilize the situation before the pro arrives. The Prompt: “I have a leak coming from [Location – e.g., under the kitchen sink]. I have basic tools: [Wrench, tape, bucket]. 1. What should I turn off immediately? 2. Give me a temporary fix to stop water damage. 3. […]

Read More
AI

AI Prompt: Modernizing Old C# Code to .NET 8 Syntax

- 28.02.26 - ErcanOPAK comment on AI Prompt: Modernizing Old C# Code to .NET 8 Syntax

Do you have old code with ArrayList and manual loops? Use this for an instant upgrade. “Act as a Senior .NET Architect. Rewrite this legacy code using C# 12 and .NET 8 features: [Paste Code]. Use Primary Constructors, File-scoped namespaces, LINQ where appropriate, and ensure it is thread-safe. Explain each major change made for performance […]

Read More
AI

AI Prompt: The ‘Second-Order Thinking’ Decision Framework

- 28.02.26 - ErcanOPAK comment on AI Prompt: The ‘Second-Order Thinking’ Decision Framework

Most people only think about the immediate consequences of a decision. Use AI to look 10 years ahead. The Prompt: “I am considering [Decision – e.g., Quitting my job to start a startup]. Act as a Strategic Analyst. Use ‘Second-Order Thinking’ to analyze: 1. Immediate effects. 2. The effects of those effects (2-3 years). 3. […]

Read More
AI

AI Prompt: The ‘Hidden Gem’ Travel Concierge

- 28.02.26 - ErcanOPAK comment on AI Prompt: The ‘Hidden Gem’ Travel Concierge

Stop following the same TripAdvisor lists. Get a local’s perspective with AI. The Prompt: “Act as a local travel expert in [City/Country]. I am visiting for [X] days. My interests are [e.g., Brutalist architecture, street food, hidden jazz bars]. 1. Create an itinerary that avoids tourist traps. 2. List 3 ‘hidden gems’ only locals know. […]

Read More
AI

AI Prompt: Architecting Complex Relational Databases

- 28.02.26 - ErcanOPAK comment on AI Prompt: Architecting Complex Relational Databases

Designing a schema is hard. Let AI handle the normalization (1NF, 2NF, 3NF). “Act as a Lead Database Architect. I need a schema for [App Description – e.g., Multi-vendor Marketplace]. 1. Provide the SQL DDL commands. 2. Explain the relationships (One-to-Many, Many-to-Many). 3. Suggest indexes for high-read performance. 4. Create a sample complex JOIN query […]

Read More
AI

AI Prompt: The ‘Rubber Duck’ Debugging Master Class

- 28.02.26 - ErcanOPAK comment on AI Prompt: The ‘Rubber Duck’ Debugging Master Class

When you have a bug that makes no sense, use this prompt to force AI into a deep analytical mode. The Prompt: “I have a bug in my [Language] code: [Paste Code]. It produces [Error/Behavior]. Act as a Senior Debugger. 1. Walk through the code line-by-line and explain the state of variables. 2. Identify potential […]

Read More
Page 1 of 6
1 2 3 4 5 6 Next Β»

Posts navigation

Older posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (859)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)
  • Add Constraint to SQL Table to ensure email contains @ (578)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (564)
  • Average of all values in a column that are not zero in SQL (531)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (489)
  • Find numbers with more than two decimal places in SQL (448)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (859)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com