Summary of "C# Eğitim Kampı Ders 11 - OOP Modülü: C# ile N Katmanlı Mimari Entity Layer"

Summary of “C# Eğitim Kampı Ders 11 - OOP Modülü: C# ile N Katmanlı Mimari Entity Layer”

This lesson introduces and implements a multi-layered (N-layer) architecture in C# with a focus on Object-Oriented Programming (OOP) principles and the Entity Layer. The instructor also covers the “Code First” approach in Entity Framework and explains how to structure a C# project into distinct layers to improve maintainability, modularity, and clarity.


Main Ideas and Concepts

Context and Introduction

Multi-layered Architecture Overview

The project is structured into four layers:

  1. Entity Layer Contains entity classes representing database tables.

  2. Data Access Layer Handles database operations.

  3. Business Layer Contains business logic and rules.

  4. Presentation Layer (User Interface) Handles user interaction; can be Windows Forms or Console.

Benefits of this architecture:

Creating the Project Structure

Entity Layer and Classes

Access Modifiers

Entities and their properties are usually public to allow access from other layers.

Properties vs Fields vs Variables

Single Responsibility Principle (SRP) from SOLID Principles

Code First Approach

Practical Steps Demonstrated

Future Topics and Additional Notes


Detailed Methodology / Instructions

Setting Up the Solution and Projects

  1. Open Visual Studio → File → New Project → Select Blank Solution.
  2. Name the solution (e.g., “C# Eğitim Kampı 301”).
  3. Add new projects for each layer:
    • Entity Layer: Class Library (.NET Framework)
    • Data Access Layer: Class Library
    • Business Layer: Class Library
    • Presentation Layer: Windows Forms Application (or Console App)
  4. Delete default class files (e.g., Class1.cs) in class libraries if not needed.
  5. Set the presentation layer as the startup project.

Creating Entity Classes

  1. Add a folder named Concrete inside the Entity Layer project.
  2. Right-click on the folder → Add → Class → Name it (e.g., Category.cs).
  3. Define public properties with get and set for each column. Use Visual Studio shortcut prop tab to create properties quickly. Example: csharp public int CategoryID { get; set; } public string CategoryName { get; set; } public bool CategoryStatus { get; set; }
  4. Follow naming conventions for primary keys (ClassNameID).
  5. Repeat for other entities: Product, Customer, Order.

Understanding Access Modifiers

Applying Code First Approach

Applying Single Responsibility Principle

Running the Application


Speakers / Sources Featured


This summary captures the key instructional content and concepts from the lesson, focusing on multi-layered architecture, entity layer creation, OOP principles, and practical steps in Visual Studio.

Category ?

Educational

Share this summary

Featured Products

Video