public AllProducts() { InitializeComponent(); using (PehlivanlarDb db = new PehlivanlarDb()) { dgProducts.ItemsSource = db.Products.Include(i => i.Category).Include(i => i.Supplier).ToList(); //Foreign keylerle bağlantı bu kodla kuruluyor. } }
private void btnUpdateSurname_Click(object sender, RoutedEventArgs e) { PehlivanlarDb db = new PehlivanlarDb(); var pehuserNew = db.PehUsers.Find(loginUser.ID); pehuserNew.Surname = txtloginUserSurname.Text; db.SaveChanges(); }
public PehUserService() { db = new PehlivanlarDb(); }