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

Tag: AI Development

AI

AI Prompt: Review Code for Security Vulnerabilities

- 16.02.26 - ErcanOPAK comment on AI Prompt: Review Code for Security Vulnerabilities

Manual security reviews miss issues. AI scans code for common vulnerabilities comprehensively. The Prompt: Review this code for security vulnerabilities: [Paste code] Check for: 1. SQL Injection 2. XSS (Cross-Site Scripting) 3. CSRF vulnerabilities 4. Authentication issues 5. Authorization flaws 6. Input validation problems 7. Sensitive data exposure 8. Insecure dependencies 9. API security issues […]

Read More
AI

AI Prompt: Generate Database Schema from Description

- 16.02.26 - ErcanOPAK comment on AI Prompt: Generate Database Schema from Description

Designing database schema takes hours. AI creates normalized schema with relationships instantly. The Prompt: Design database schema for: [Describe your application] Requirements: 1. Normalized (3NF minimum) 2. Include primary keys, foreign keys 3. Add indexes for common queries 4. Specify data types (be specific) 5. Add constraints (NOT NULL, UNIQUE, etc.) 6. Show relationships (1:1, […]

Read More
AI

AI Prompt: Create API Documentation from Code

- 15.02.26 - ErcanOPAK comment on AI Prompt: Create API Documentation from Code

Writing API docs is boring. AI generates beautiful documentation from your endpoints. The Prompt: Create API documentation for these endpoints: [Paste controller/routes code] Format as: 1. Endpoint overview table 2. For each endpoint: – HTTP method and path – Description – Request parameters (query, path, body) – Request example (curl + code) – Response format […]

Read More
AI

AI Prompt: Refactor Legacy Code to Modern Patterns

- 15.02.26 - ErcanOPAK comment on AI Prompt: Refactor Legacy Code to Modern Patterns

Cleaning up old code manually takes days. AI refactors to modern patterns while preserving logic. The Prompt: Refactor this legacy code to modern best practices: [Paste old code] Target language version: [e.g., C# 11, ES2023] Apply: 1. Modern syntax (async/await, arrow functions, etc.) 2. Design patterns where appropriate 3. Better naming conventions 4. Remove code […]

Read More
AI

AI Prompt: Generate Unit Tests from Existing Code

- 15.02.26 - ErcanOPAK comment on AI Prompt: Generate Unit Tests from Existing Code

Writing tests is tedious but necessary. AI generates comprehensive test cases automatically. The Prompt: Generate unit tests for this code: [Paste your function/class] Requirements: 1. Use [testing framework – e.g., Jest, xUnit, pytest] 2. Test happy path 3. Test edge cases (null, empty, invalid input) 4. Test error handling 5. Include setup/teardown if needed 6. […]

Read More
AI

AI Prompt: Create Comprehensive README for GitHub Project

- 15.02.26 - ErcanOPAK comment on AI Prompt: Create Comprehensive README for GitHub Project

README writing is tedious. AI creates professional documentation from your code. The Prompt: Create README.md for this project: Project description: [Brief description] Main files: [List key files] Tech stack: [Languages/frameworks] Purpose: [What it does] Include: – Project title with badges – Description – Features list – Installation steps – Usage examples – Configuration options – […]

Read More
AI

AI Prompt: Generate SQL Queries from Plain English Descriptions

- 14.02.26 - ErcanOPAK comment on AI Prompt: Generate SQL Queries from Plain English Descriptions

Know what data you need but struggling with SQL syntax? AI writes the query for you. The Prompt: Write SQL query for this: Database: Ecommerce Tables: Users (id, name, email), Orders (id, user_id, total, created_at) I need: Top 10 customers by total order value in last 30 days Also explain what each part does. AI […]

Read More
AI

AI Prompt: Debug Code by Explaining Error Message in Plain English

- 14.02.26 - ErcanOPAK comment on AI Prompt: Debug Code by Explaining Error Message in Plain English

Cryptic error messages confusing you? AI explains what they mean and how to fix them. The Prompt: I got this error in [language/framework]: [Paste full error message and stack trace] Please explain: 1. What this error means in plain English 2. What likely caused it 3. How to fix it with code example 4. How […]

Read More
AI

AI Prompt: Generate Regex Patterns with Explanation and Test Cases

- 13.02.26 - ErcanOPAK comment on AI Prompt: Generate Regex Patterns with Explanation and Test Cases

Struggling with regex syntax? AI writes the pattern and explains how it works. The Prompt: Create a regex pattern that matches: – US phone numbers in formats: (555) 123-4567, 555-123-4567, 5551234567 Provide: 1. The regex pattern 2. Explanation of each part 3. 5 test cases (3 valid, 2 invalid) 4. Code example in JavaScript AI […]

Read More
AI

AI Prompt: Generate Realistic Test Data for Development

- 13.02.26 - ErcanOPAK comment on AI Prompt: Generate Realistic Test Data for Development

Need 100 fake users for testing? AI generates realistic test data instantly. The Prompt: Generate 50 realistic user records as JSON with: – First name, last name – Email (use fake domains) – Phone number (US format) – Address (real US cities, fake street addresses) – Birthday (ages 18-80) – Account balance (random $0-$10,000) Make […]

Read More
AI

AI Coding Assistant: ChatGPT Prompts That Generate Production-Ready Code

- 05.02.26 - ErcanOPAK comment on AI Coding Assistant: ChatGPT Prompts That Generate Production-Ready Code

Tired of AI giving you buggy code snippets? These structured prompts extract perfect, tested code from ChatGPT and Copilot. The Structure for Perfect Code Generation: ROLE: Senior [Language] Developer with 10 years experience TASK: Create [specific feature] CONSTRAINTS: [technical limitations] REQUIREMENTS: [must-have features] OUTPUT FORMAT: [code structure] TEST: [validation criteria] Example: ROLE: Senior C#/.NET Developer […]

Read More
February 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
232425262728  
« Jan    

Most Viewed Posts

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

Recent Posts

  • C#: Use MemoryPack for 10x Faster Serialization than JSON
  • C#: Use params ReadOnlySpan for Allocation-Free Variable Arguments
  • C#: Use ObjectPool for Reusing Expensive Objects
  • C#: Use Lazy for Expensive Object Initialization
  • SQL: Use STRING_AGG to Concatenate Rows into Comma-Separated List
  • SQL: Use Filtered Indexes to Index Only Subset of Rows
  • .NET Core: Use Result Pattern to Avoid Exceptions for Expected Errors
  • .NET Core: Use IOptions Pattern for Strongly-Typed Configuration
  • Git: Use .gitattributes to Handle Line Endings Across OS
  • Git: Use git notes to Add Comments to Commits Without Changing History

Most Viewed Posts

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

Recent Posts

  • C#: Use MemoryPack for 10x Faster Serialization than JSON
  • C#: Use params ReadOnlySpan for Allocation-Free Variable Arguments
  • C#: Use ObjectPool for Reusing Expensive Objects
  • C#: Use Lazy for Expensive Object Initialization
  • SQL: Use STRING_AGG to Concatenate Rows into Comma-Separated List

Social

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