Beispiel #1
0
        public Repository(CrudContext context, IExceptionLogger logger)
        {
            _context = context;
            _dbSet   = context.Set <TEntity>();

            _logger = logger;
        }
Beispiel #2
0
 public void Create()
 {
     try
     {
         var db        = new CrudContext();
         var employees = db.Set <Employee>().ToList();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex);
     }
 }
Beispiel #3
0
 public Repository(CrudContext context)
 {
     this._context = context;
     this._dbSet   = context.Set <TEntity>();
 }
 public RepositorioEntity(CrudContext context)
 {
     Db    = context;
     DbSet = Db.Set <TEntity>();
 }
Beispiel #5
0
 public Repository(CrudContext con)
 {
     Db    = con;
     DbSet = Db.Set <TEntity>();
 }
Beispiel #6
0
 public GenericService(CrudContext context)
 {
     Context      = context;
     currentDbSet = Context.Set <T>();
 }
Beispiel #7
0
 public void Add <T>(T entity) where T : class
 {
     data.Set <T>().Add(entity);
 }
Beispiel #8
0
 public TEntity Get(int id)
 {
     return(_dbContext.Set <TEntity>().Find(id));
 }