private List<CurrencyStamp> GetCurrencyStamps() { List<CurrencyStamp> stampsAll = null; using (CurrencyDbContext context = new CurrencyDbContext()) { stampsAll = context.CurrencyStamps.ToList(); } return stampsAll; }
protected void RefreshButton_Click(object sender, EventArgs e) { using (CurrencyDbContext context = new CurrencyDbContext()) { List<CurrencyStamp> stamps = context.CurrencyStamps.ToList(); if (!IsPostBack) { StampDataRepeater.DataSource = stamps; StampDataRepeater.DataBind(); } } }
private void InitDatabase() { _currencyDbContext = new CurrencyDbContext(); }