public MainWindow() { InitializeComponent(); using (var context = new HotelPlazaContext()) { } }
private void AddClient_Click(object sender, RoutedEventArgs e) { using (var context = new HotelPlazaContext()) { context.Clients.Add(NewClient); context.SaveChanges(); } DialogResult = true; Close(); }