Skip to content

MikeS2058/study-advanced-csharp

Repository files navigation

Learning_AdvancedCSharpStudies

A comprehensive study project for advanced C# language features and modern .NET patterns


πŸ“– Overview

This repository serves dual purposes:

  1. Learning Project: Explore and practice advanced C# language features (C# 12, 13, 14) and modern .NET patterns
  2. AI Configuration Template Source: Maintain reusable AI assistant configuration files via the AITransfer/ directory for use in other C# / .NET projects

What You'll Find Here

  • Modern C# Implementations: Examples and studies of cutting-edge C# features
  • Best Practice Patterns: Extension methods, file-scoped namespaces, primary constructors, and more
  • AI-Ready Templates: Pre-configured GitHub Copilot and Junie AI instructions
  • Comprehensive Documentation: Detailed guides, summaries, and architectural decisions

πŸš€ Tech Stack

Component Version Notes
.NET SDK 10.0.100 Defined in global.json
Target Framework net10.0 Latest .NET
C# Language 14 Cutting-edge features
IDE JetBrains Rider With terminal output optimizations
Shell PowerShell Windows-based development

Key Settings:

  • βœ… Nullable Reference Types: Enabled
  • βœ… Implicit Usings: Enabled
  • βœ… File-Scoped Namespaces: Enforced
  • βœ… Modern C# Patterns: Mandatory

πŸ“ Repository Structure

Learning_AdvancedCSharpStudies/
β”œβ”€β”€ Learning_AdvancedCSharpStudies/    # Main console application
β”‚   β”œβ”€β”€ Program.cs                     # Application entry point
β”‚   └── [Feature].cs                   # C# feature implementations
β”‚
β”œβ”€β”€ AITransfer/                        # 🎯 AI configuration templates
β”‚   β”œβ”€β”€ copilot-instructions.md        # GitHub Copilot template
β”‚   β”œβ”€β”€ junie-guidelines.md            # Junie AI template
β”‚   β”œβ”€β”€ .editorconfig                  # Code style rules template
β”‚   β”œβ”€β”€ .gitignore                     # Git ignore template
β”‚   β”œβ”€β”€ global.json                    # .NET SDK template
β”‚   β”œβ”€β”€ README.md                      # AITransfer usage guide
β”‚   β”œβ”€β”€ SETUP_GUIDE.md                 # Step-by-step setup
β”‚   β”œβ”€β”€ QUICK_REFERENCE.md             # Quick start reference
β”‚   β”œβ”€β”€ CUSTOMIZATION_CHECKLIST.md     # Template customization guide
β”‚   └── TROUBLESHOOTING.md             # Common issues and solutions
β”‚
β”œβ”€β”€ docs/                              # Project documentation
β”‚   β”œβ”€β”€ AITRANSFER_SYNC_SUMMARY.md     # Template synchronization guide
β”‚   β”œβ”€β”€ RIDER_TERMINAL_OUTPUT_FIX.md   # Rider IDE terminal fix
β”‚   └── [other summaries]              # Feature and refactoring docs
β”‚
β”œβ”€β”€ .github/                           # GitHub & AI configuration
β”‚   β”œβ”€β”€ copilot-instructions.md        # Active GitHub Copilot config
β”‚   └── global-copilot-instructions.md # General development guidelines
β”‚
β”œβ”€β”€ .junie/                            # Junie AI configuration
β”‚   └── guidelines.md                  # Active Junie AI config
β”‚
β”œβ”€β”€ .editorconfig                      # Active code style rules
β”œβ”€β”€ .gitignore                         # Active git ignore patterns
β”œβ”€β”€ global.json                        # Active .NET SDK version
└── Learning_AdvancedCSharpStudies.sln # Visual Studio solution

🎯 Core Coding Principles

This project enforces modern C# best practices:

1. Modern Patterns (Mandatory)

  • βœ… Extension methods over static utilities
  • βœ… File-scoped namespaces (namespace MyProject;)
  • βœ… One type per file (enforced at warning level)
  • βœ… Primary constructors (C# 12+)
  • βœ… No this. qualifiers (enforced)
  • βœ… Predefined types (int, string not Int32, String)

2. Documentation Standards

  • βœ… XML documentation on all public APIs
  • βœ… <param> and <returns> tags for methods
  • βœ… Proper use of <see>, <paramref>, etc.

3. Testing Philosophy

  • βœ… Comprehensive edge case coverage
  • βœ… Theory-based parameterized tests
  • βœ… Descriptive test method names
  • βœ… Assertion libraries (e.g., FluentAssertions)

πŸ› οΈ Getting Started

Prerequisites

  • .NET SDK 10.0.100 or higher
  • JetBrains Rider (recommended) or Visual Studio 2022+
  • PowerShell 5.1 or higher
  • Git

Clone and Build

# Clone the repository
git clone https://github.com/YOUR_USERNAME/Learning_AdvancedCSharpStudies.git
cd Learning_AdvancedCSharpStudies

# Restore dependencies and build
dotnet restore
dotnet build Learning_AdvancedCSharpStudies.sln -c Debug --verbosity normal

# Run the application
dotnet run --project .\Learning_AdvancedCSharpStudies\Learning_AdvancedCSharpStudies.csproj

Rider Users: Terminal Output Configuration

If you don't see build/test output in Rider's terminal, use verbosity flags:

# Build with visible output
dotnet build Learning_AdvancedCSharpStudies.sln -c Debug --verbosity normal

# Test with visible output
dotnet test Learning_AdvancedCSharpStudies.sln --verbosity normal

Configure Rider for Better Terminal Output:

  1. MSBuild Verbosity (Recommended):

    • Settings (Ctrl+Alt+S or File β†’ Settings)
    • Navigate to: Build, Execution, Deployment β†’ Toolset and Build
    • Set "MSBuild verbosity" to Normal or Detailed
  2. Alternative Output Locations:

    • Build output: View β†’ Tool Windows β†’ Build (or Alt+0)
    • Test results: View β†’ Tool Windows β†’ Unit Tests (or Alt+8)
    • Run output: View β†’ Tool Windows β†’ Run (or Alt+4)

πŸ“– Detailed Guides:


πŸ“¦ AITransfer Templates

What is AITransfer?

The AITransfer/ directory contains reusable AI configuration templates for new C# / .NET projects. These templates help maintain:

  • βœ… Consistent AI assistant behavior (GitHub Copilot, Junie AI)
  • βœ… Unified coding standards across projects
  • βœ… Modern C# best practices
  • βœ… Proper build/test configurations

Using AITransfer in New Projects

  1. Copy the AITransfer/ folder to your new repository
  2. Run the setup commands from AITransfer/SETUP_GUIDE.md
  3. Customize files using AITransfer/CUSTOMIZATION_CHECKLIST.md
  4. Build and verify your project

Quick Start: See AITransfer/QUICK_REFERENCE.md

Template Synchronization

Important: As AI instructions evolve in this repository, they must be synchronized to AITransfer/ templates for reuse in new projects.

See docs/AITRANSFER_SYNC_SUMMARY.md for synchronization workflow.


πŸ“š Documentation

Document Purpose
AITransfer/README.md AITransfer usage guide
AITransfer/SETUP_GUIDE.md Step-by-step setup for new projects
AITransfer/QUICK_REFERENCE.md Quick start reference
AITransfer/TROUBLESHOOTING.md Common issues and solutions
docs/AITRANSFER_SYNC_SUMMARY.md Template synchronization guide
docs/RIDER_UI_FIX_VISUAL_GUIDE.md Rider terminal fix - Visual step-by-step guide ⭐
docs/RIDER_TERMINAL_OUTPUT_FIX.md Rider IDE terminal - Technical documentation
.github/copilot-instructions.md GitHub Copilot coding standards
.junie/guidelines.md Junie AI assistant guidelines

πŸ”§ Development Workflow

Build Commands (PowerShell)

# Build Debug
dotnet build Learning_AdvancedCSharpStudies.sln -c Debug --verbosity normal

# Build Release
dotnet build Learning_AdvancedCSharpStudies.sln -c Release --verbosity normal

# Run Application
dotnet run --project .\Learning_AdvancedCSharpStudies\Learning_AdvancedCSharpStudies.csproj

# Clean Artifacts
Get-ChildItem -Recurse -Directory -Include bin,obj | Remove-Item -Recurse -Force

Testing Commands

# Run all tests (when test project exists)
dotnet test Learning_AdvancedCSharpStudies.sln --verbosity normal

# Run with detailed output
dotnet test Learning_AdvancedCSharpStudies.sln --verbosity detailed

# Run specific test class
dotnet test --filter FullyQualifiedName~[TestClassName] --verbosity normal

Note: Always use --verbosity normal for visible output in Rider terminal.


πŸŽ“ Learning Topics Covered

This repository explores advanced C# features including:

  • C# 12+: Primary constructors, collection expressions
  • C# 13+: Latest language enhancements
  • C# 14: Cutting-edge experimental features
  • Pattern Matching: Advanced patterns and switch expressions
  • LINQ: Modern query patterns and extension methods
  • Async/Await: Asynchronous programming patterns
  • Records & Structs: Modern data types
  • Nullable Reference Types: Null-safety patterns
  • Generic Constraints: Advanced generic programming

(More topics to be added as the project evolves)


🀝 Contributing

This is primarily a personal learning repository, but suggestions and improvements are welcome:

  1. For AI Configuration Templates: Ensure changes are synchronized between active files and AITransfer/ templates
  2. For Code Examples: Follow the established coding principles
  3. For Documentation: Update relevant markdown files in docs/

πŸ“‹ Quick Reference

Task Command
Build Debug dotnet build Learning_AdvancedCSharpStudies.sln -c Debug --verbosity normal
Build Release dotnet build Learning_AdvancedCSharpStudies.sln -c Release --verbosity normal
Run App dotnet run --project .\Learning_AdvancedCSharpStudies\Learning_AdvancedCSharpStudies.csproj
Test All dotnet test Learning_AdvancedCSharpStudies.sln --verbosity normal
Clean Get-ChildItem -Recurse -Directory -Include bin,obj | Remove-Item -Recurse -Force

πŸ“„ License

This project is for educational purposes. Feel free to use the AITransfer templates in your own projects.


πŸ”— Related Resources


Last Updated: December 2, 2025
Version: 1.0 β€” Initial repository setup with AITransfer templates

About

Advanced C# language features and patterns study project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •