Skip to content

platyscript/Platy.AdventureWorks.Repository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Project

NuGet Version

Overview

A project template that I use to quickly create a set of repository classes for interacting with any existing database.

Features

  • The DbContext class is internal, which means that external libraries users cannot make db changes without interacting with the repository classes.
  • The repository classes validate the entities before making changes to the database keeping it clean.
  • A Result type is returned in case of success or failure, instead of relying on exceptions. Makes testing and validation easier.
  • A notification is published for every Create, Update and Delete event. External libraries can subscribe to these events and accordingly perform any required action.
  • csx templates to customize the entities,the repository classes and the model classes that are output by the generator.
  • Integration tests using TestContainers helps testing the repository classes with a real database that is spun up and down as the tests execute.

Build solution

First, initialize the submodules using git submodule update --init.

Build the solution - Platy.AdventureWorks.Repository.sln.

Open the solution - EntityFrameworkCore.Generator/EntityFrameworkCore.Generator.sln and build it. This is one of the submodules downloaded.

Execute the command ..\..\efg\EntityFrameworkCore.Generator.exe generate -f .\entity-generation.yml from the directory of Platy.AdventureWorks.Repository.csproj. This generates the domain files. Make sure the AdventureWorks database is available.

About

A project template for database interactions using the repository pattern.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages