private void SaveBtn_Click(object sender, RoutedEventArgs e) { using (var db = new StockContext()) { stock.Save(); } }