Created
April 15, 2018 17:21
-
-
Save NMZivkovic/5e92884472ec579d8bc27dc785b7ceea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Repository<TEntity> : IReporitory<TEntity> where TEntity : class | |
{ | |
protected readonly DbContext Context; | |
protected readonly DbSet<TEntity> Entities; | |
public Repository(DbContext context) | |
{ | |
Context = context; | |
Entities = Context.Set<TEntity>(); | |
} | |
public void Add(TEntity entity) | |
{ | |
Entities.Add(entity); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment