https://github.com/aimenux/repositorypatterndemo
Using repository pattern with entity framework in web api projects
https://github.com/aimenux/repositorypatterndemo
efcore integration-tests net80 repository-pattern unit-of-work-pattern unit-tests
Last synced: 4 months ago
JSON representation
Using repository pattern with entity framework in web api projects
- Host: GitHub
- URL: https://github.com/aimenux/repositorypatterndemo
- Owner: aimenux
- License: mit
- Created: 2023-12-23T14:46:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-17T14:57:34.000Z (over 1 year ago)
- Last Synced: 2025-01-10T00:24:54.604Z (6 months ago)
- Topics: efcore, integration-tests, net80, repository-pattern, unit-of-work-pattern, unit-tests
- Language: C#
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/aimenux/RepositoryPatternDemo/actions/workflows/ci.yml)
# RepositoryPatternDemo
```
Using repository pattern with entity framework in web api projects
```In this repo, i m exploring various ways of using repository pattern in web api projects
>
> :heavy_minus_sign: `Example01` use controller api with directly the db context
>
> :heavy_minus_sign: `Example02` use minimal api with directly the db context
>
> :heavy_minus_sign: `Example03` use controller api with specific repository
>
> :heavy_minus_sign: `Example04` use minimal api with specific repository
>
> :heavy_minus_sign: `Example05` use controller api with generic repository
>
> :heavy_minus_sign: `Example06` use minimal api with generic repository
>
> :heavy_minus_sign: `Example07` use controller api with generic repository & specific unit of work
>
> :heavy_minus_sign: `Example08` use minimal api with generic repository & specific unit of work
>
> :heavy_minus_sign: `Example09` use controller api with generic repository & generic unit of work
>
> :heavy_minus_sign: `Example10` use minimal api with generic repository & generic unit of work
>
> In order to setup the database, follow these steps for some example :
> - Run this docker command : `docker run -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=Pa55w0rd’ -p 1433:1433 -d mcr.microsoft.com/mssql/server`
> - Use this connection string : `"Data Source=localhost;Initial Catalog=BooksDB;User Id=sa;Password=Pa55w0rd;TrustServerCertificate=True;"`
> - Run database migrations : `dotnet-ef database update`
>**`Tools`** : net 8.0, ef-core, xunit, fluent-assertions