/// <summary> /// Creates instance of <see cref="AgencyRepository{TEntity}"/> /// </summary> /// <param name="context"></param> public AgencyRepository(AgencyContext context) { _context = context; _dataBaseSet = context.Set <TEntity>(); }
/// <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(); }