https://github.com/ardalis/dotnetdataaccesstour
A tour of different data access approaches in .NET 8+.
https://github.com/ardalis/dotnetdataaccesstour
dapper data design-patterns dotnet dotnet-core entity-framework-core repository repository-pattern specification sql-server
Last synced: 7 months ago
JSON representation
A tour of different data access approaches in .NET 8+.
- Host: GitHub
- URL: https://github.com/ardalis/dotnetdataaccesstour
- Owner: ardalis
- License: mit
- Created: 2021-03-16T15:44:06.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-08T16:13:33.000Z (about 1 year ago)
- Last Synced: 2025-05-25T11:06:59.409Z (8 months ago)
- Topics: dapper, data, design-patterns, dotnet, dotnet-core, entity-framework-core, repository, repository-pattern, specification, sql-server
- Language: C#
- Homepage:
- Size: 787 KB
- Stars: 111
- Watchers: 5
- Forks: 25
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dot Net Data Access Tour
A tour of different data access approaches in .NET 9+.
**Note:** This is meant to demonstrate different ways to make data access calls, not best practices (or even reasonably good practices) for building ASP.NET Core Web APIs.
## Related Videos
- [Custom Specifications with EF Core](https://www.youtube.com/watch?v=i5FvDLsSrn0) @ardalis, 2024
- [Improving Data Access with Abstractions](https://www.youtube.com/watch?v=g6cjCbxq54Y) Stir Trek, 2023
## Data Access Options (CRUD + Queries)
- ADO.NET Custom SQL
- ADO.NET Stored Procs
- Dapper Custom SQL
- Dapper Stored Procs
- EF Core + Custom Queries
## Additional Options
- Repository layer
- Application layer
## Running the App - Create the Database
EF and its Migrations are not required for all of these variants, but it does provide a quick and easy way to get your data in place if you want to run these samples. Just run this command from the `WebDataDemo` folder:
Run this command to get ef core tools:
```powershell
dotnet tool install --global dotnet-ef
```
```powershell
dotnet ef database update
```
## Running Seq in a local Docker instance
Run this command:
```powershell
docker run --name seqlogger -d -p 5341:5341 -p 5342:80 -e ACCEPT_EULA=Y datalust/seq
```
Verify Seq is running: http://localhost:5342
## Running k6 scripts
Install k6:
```powershell
choco install k6
```
Run scripts from the k6 folder.
```powershell
k6 run data-strategy-01.js
```