This project demonstrates the implementation of a layered architecture using ASP.NET Core Web API. It follows a clean and maintainable design pattern, separating concerns into distinct layers such as Service, Repository, and Entity. Each layer handles specific responsibilities, ensuring scalability, testability, and ease of future modifications.
Read the full article here: WebAPI : Layered Architecture Design (NTier)
This guide explains how to set up and run the project on your local machine.
- Visual Studio (2019 or later)
- .NET Framework (4.7.2 or later)
- SQL Server (LocalDB or full version)
- EntityFrameWork (6.0.35)
-
Clone the repository:
$ https://github.com/serkanyasr/WebAPI-NTier-Architecture.git $ cd WebAPI-NTier-Architecture
-
Open the project in Visual Studio:
- Open the
WebAPI.sln
file in the WebAPI folder with Visual Studio.
- Open the
-
Configure the database connection:
- Update the connection string in the
appsettings.json
file with your database details.
"ConnectionStrings": { "SqlConnection": "Data Source=(localdb)\\MSSQLLocalDB; Initial Catalog=DbNtier;Integrated Security=True" }
- Update the connection string in the
-
Apply database migrations:
- Open the Package Manager Console (Tools > NuGet Package Manager > Package Manager Console).
- Run the following command to update the database:
Update-Database
-
Start the application:
- Press F5 or click the "Start" button to run the project.
We welcome contributions! Please open an issue first to discuss what you would like to change before submitting a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature-name
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature-name
) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or feedback, please contact us at: yasarserkan016@gmail.com