Exemplo n.º 1
0
 /// <summary>
 /// Creates instance of <see cref="AgencyRepository{TEntity}"/>
 /// </summary>
 /// <param name="context"></param>
 public AgencyRepository(AgencyContext context)
 {
     _context     = context;
     _dataBaseSet = context.Set <TEntity>();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Updates <see cref="TEntity"/> item in the corresponding <see cref="DbContext"/>
 /// </summary>
 /// <param name="item"><see cref="TEntity"/> item to update</param>
 public void Update(TEntity item)
 {
     _context.Set <TEntity>().AddOrUpdate(item);
     _context.SaveChanges();
 }