Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sararasoulian/webapi-sample-dotnet-7
🌱 A Sample Web API Application (.NET 7)
https://github.com/sararasoulian/webapi-sample-dotnet-7
asp-net-core clean-architecture code-first-approach docker entity-framework-core postgresql repository-pattern restful-api tdd unitofwork-pattern
Last synced: about 2 months ago
JSON representation
🌱 A Sample Web API Application (.NET 7)
- Host: GitHub
- URL: https://github.com/sararasoulian/webapi-sample-dotnet-7
- Owner: SaraRasoulian
- License: mit
- Created: 2023-08-27T16:35:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-25T06:12:49.000Z (6 months ago)
- Last Synced: 2024-07-25T07:28:59.974Z (6 months ago)
- Topics: asp-net-core, clean-architecture, code-first-approach, docker, entity-framework-core, postgresql, repository-pattern, restful-api, tdd, unitofwork-pattern
- Language: C#
- Homepage:
- Size: 77.1 KB
- Stars: 28
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## ASP.NETCore Web API Sample
This repository is a sample ASP.NET Core Web API (.NET 7) project.
## Features & Technologies
- ASP.NET Core Web API
- Entity Framework Core
- Clean Architecture
- Unit Of Work Pattern
- Repository Service Pattern
- TDD
- PostgreSQL
- Docker## Get started
#### 1. Clone the repository
```
git clone https://github.com/SaraRasoulian/WebAPI-Sample-DotNet-7.git
```
#### 2. Start with docker composeMake sure [docker](https://docs.docker.com/get-docker/) is installed on your machine.
Run the following command in project directory:
```
docker-compose up -d
```Docker compose in this project includes 3 services: web API application, postgres and pgadmin4.
- Web API application will be running and listening at `http://localhost:5000`
- Postgres database will be listening at `http://localhost:5433`
- PgAdmin4 web interface will be listening at `http://localhost:8080`
To apply your modified code, you can add build option:
```
docker-compose up -d --build
```To stop and remove all containers, use the following command:
```
docker-compose down
```#### 3. Run the migrations
Open Sample.sln file in visual studio, then in package manager console tab, run:
```
update-database
```This command will generate the database schema in postgres container.
## Contributions
Contributions are welcomed! If you identify areas for improvement, please feel free to raise an issue or submit a pull request.