Skip to content

Repository class using generics for working with Entity Framework Core

License

Notifications You must be signed in to change notification settings

kmkatsma/EntityFrameworkCore.GenericRepository

Repository files navigation

EntityFrameworkCore.GenericRepository

This is a simple implementation of a generic repository class that accepts a DbContext in constructor, and supports basic CRUD operations on model classes.

To use the generic repository, you must inherit from the included BaseEntity class, which allows the repository class to support any class via Generics.

For usage, see the test case examples in RepositoryTests.cs, which use the EF Core in memory database to do basic operations.

The Generic Repository class currently supports Add, Update, Delete, and FindByID, and allows to optionally trigger SaveChanges. All methods use async implementation.

The dll is currentlly targeting .net standard 1.6.

About

Repository class using generics for working with Entity Framework Core

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages