public MainWindow() { InitializeComponent(); using (CarEntities context = new CarEntities()) { dataGrid.ItemsSource = context.Cars.ToList(); } }