Generisches Repository -Muster für .net Core mit DapperC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Generisches Repository -Muster für .net Core mit Dapper

Post by Anonymous »

Ich habe ein Tutorial zum generischen Repository -Muster mit ASP.NET Core mit EF Core,
hier
verfolgt, z. B. < /p>

Code: Select all

   public class Repository : IRepository where T : class
{
protected readonly DbContext _dbContext;
protected readonly DbSet _dbSet;

public Repository(DbContext context)
{
_dbContext = context ?? throw new
ArgumentException(nameof(context));
_dbSet = _dbContext.Set();
}

public void Add(T entity)
{
_dbSet.Add(entity);
}
}
Da dies mit dem EF -Core verwendet wird>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post