Skip to content

Monoversity-One/CSharp-Compact-Course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C# Compact Course

Welcome to the C# Compact Course repository! This repository contains comprehensive learning materials covering fundamental to advanced topics in C# programming, curated by Elliot One. The course is designed to provide hands-on experience through practical examples and exercises.

Prerequisites

  • Visual Studio 2022 or later (recommended)
  • .NET 6.0 SDK or later
  • .NET Framework 4.7.2 (for GUI Programming module)
  • Basic understanding of programming concepts

Course Content

    • Variables and data types (int, double, string, char, bool)
    • Variable initialization and assignment
    • Operators and expressions (arithmetic, comparison, logical)
    • Type conversion and casting (implicit and explicit)
    • String interpolation
    • Constants and readonly fields
    • Nullable types
    • If statements
    • If-Else statements
    • Else-If chains
    • Switch statements
    • Ternary operator
    • For loops
    • While loops
    • Do-While loops
    • Break and Continue statements
    • Nested loops
    • Single-dimensional arrays
    • Multi-dimensional arrays
    • Jagged arrays
    • Array manipulation and iteration
    • Lists (List<T>)
    • Dictionaries (Dictionary<TKey, TValue>)
    • HashSets (HashSet<T>)
    • Queues and Stacks
    • Collection initialization
    • Common collection operations
    • Method declaration and definition
    • Method parameters (value, ref, out)
    • Return values
    • Method overloading
    • Optional parameters
    • Named arguments
    • Recursive methods
    • Expression-bodied members
    • Local functions
    • Extension methods
    • Classes and objects
    • Encapsulation
      • Access modifiers (public, private, protected, internal)
      • Properties and fields
      • Auto-implemented properties
    • Inheritance
      • Base and derived classes
      • Method overriding
      • Virtual and override keywords
      • Base keyword
    • Polymorphism
      • Method overriding
      • Abstract classes and methods
      • Interfaces
    • Constructors and destructors
    • Try-Catch blocks
    • Multiple catch blocks
    • Finally block
    • Throwing exceptions
    • Custom exceptions
    • Exception properties
    • Best practices for exception handling
    • Practical example: Bank account with custom InsufficientFundsException
    • Reading from text files
      • File.ReadAllText()
      • File.ReadAllLines()
      • StreamReader
    • Writing to text files
      • File.WriteAllText()
      • File.WriteAllLines()
      • StreamWriter
    • Appending to files
    • File and directory operations
    • Path manipulation
    • Using statements and IDisposable
    • Error handling in file operations
    • Windows Forms introduction
    • Creating a simple GUI application
    • Controls (TextBox, Button, Label)
    • Event handling
    • Practical project: Quadratic equation solver
      • Input validation
      • Mathematical calculations
      • Displaying results
    • Note: Uses .NET Framework 4.7.2
    • Console.WriteLine() debugging
    • Breakpoints
    • Step Over, Step Into, Step Out
    • Watch windows
    • Locals and Autos windows
    • Call stack
    • Conditional breakpoints
    • Debug vs Release builds
    • Common debugging scenarios
    • LINQ query syntax
    • LINQ method syntax
    • Querying collections
    • Filtering data (Where)
    • Selecting and transforming data (Select)
    • Ordering data (OrderBy, OrderByDescending)
    • Grouping data (GroupBy)
    • Aggregation operations (Sum, Average, Count, Min, Max)
    • Joining data
    • Deferred execution
    • Practical examples with various data types
    • Introduction to async/await
    • Async methods
    • Task and Task<T>
    • Awaiting asynchronous operations
    • Async void vs async Task
    • Exception handling in async methods
    • Practical examples:
      • Simulating long-running operations
      • Asynchronous file I/O
      • Multiple concurrent operations
      • Task.WhenAll and Task.WhenAny
    • Stack vs Heap memory
    • Value types vs Reference types
    • Garbage collection
    • IDisposable interface
    • Using statement
    • Dispose pattern
    • Finalizers
    • Memory leaks prevention
    • Best practices for resource management
    • Introduction to unit testing
    • MSTest framework
    • Test attributes ([TestClass], [TestMethod])
    • Assertions (Assert.AreEqual, Assert.IsTrue, etc.)
    • Test organization
    • Testing best practices
    • Practical test examples:
      • Calculator tests
      • String utility tests
      • Math utility tests
      • Counter tests
      • Testing private methods

Getting Started

Clone the Repository

git clone <repository-url>
cd "C# Compact Course"

Open the Solution

  1. Open C# Compact Course.sln in Visual Studio
  2. The solution contains 13 projects, one for each session
  3. Set the desired project as the startup project (right-click → Set as Startup Project)
  4. Press F5 to run the project

Running Individual Sessions

Each session is a standalone console application (except Session 8 which is a Windows Forms application). You can:

  1. Navigate to the specific session folder
  2. Review the code examples
  3. Run the project to see the output
  4. Modify the code to experiment with different concepts

Project Structure

C# Compact Course/
├── 1.BasicSyntaxAndDataTypes/
├── 2.ControlFlowAndDecisionMaking/
├── 3.ArraysAndCollections/
├── 4.FunctionsAndMethods/
├── 5.Object-OrientedProgrammingBasics/
├── 6.ExceptionHandling/
├── 7.FileIO/
├── 8.GUIProgrammingBasics/
├── 9.BasicDebuggingTechniques/
├── 10.IntroductionToLINQ/
├── 11.AsynchronousProgrammingBasics/
├── 12.MemoryManagementBasics/
├── 13.UnitTesting/
├── C# Compact Course.sln
├── LICENSE.txt
└── README.md

Learning Path

This course is designed to be followed sequentially, as each session builds upon concepts from previous sessions:

  1. Foundations (Sessions 1-4): Core syntax, control flow, data structures, and functions
  2. Object-Oriented Programming (Session 5): Classes, inheritance, polymorphism, and encapsulation
  3. Error Handling & I/O (Sessions 6-7): Exception handling and file operations
  4. Application Development (Sessions 8-9): GUI programming and debugging
  5. Advanced Topics (Sessions 10-13): LINQ, async programming, memory management, and testing

Additional Resources

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

Author

Elliot One


Happy Coding! 🚀

About

CSharp Compact Course source code by Elliot One

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages