public void edytujKategoriePrzepisow(string edytowanaKategoria, string nazwa) { Kategorie_Przepisy org = context.Kategorie_Przepisy.First(x => x.P_NAZWA == edytowanaKategoria); org.P_NAZWA = nazwa; context.SaveChanges(); }
public void usunKategoriePrzepisow(string nazwa) { Kategorie_Przepisy kp = context.Kategorie_Przepisy.First(x => x.P_NAZWA == nazwa); context.Kategorie_Przepisy.Remove(kp); context.SaveChanges(); }
public int dodajKategoriePrzepisow(string nazwa) { Kategorie_Przepisy kp = new Kategorie_Przepisy(); kp.P_NAZWA = nazwa; context.Kategorie_Przepisy.Add(kp); context.SaveChanges(); return(kp.P_ID_KATEGORII); }