Skip to content

Instantly share code, notes, and snippets.

@Mdyunus56
Mdyunus56 / BaseRepository.cs
Created March 9, 2021 07:34 — forked from pmbanugo/BaseRepository.cs
Implementation of the Repository and UnitOfWork pattern using Entity Framework.
// A generic base repository which other repositories (if needed) can inherit from
public class BaseRepository<TEntity> : IEntityRepository<TEntity> where TEntity : class
{
internal DataContext context;
internal DbSet<TEntity> dbSet;
public BaseRepository(DataContext context)
{
this.context = context;