public int ObrisiFilm(Film f) { using (VideoKlubEntities db = new VideoKlubEntities()) { try { db.Entry(f).State = EntityState.Deleted; db.SaveChanges(); return(0); } catch (Exception) { return(-1); } } }
public int UbaciFilm(Film f) { using (VideoKlubEntities db = new VideoKlubEntities()) { try { db.Entry(f).State = EntityState.Added; // Drugi nacin za ubacivanje pomocu EntityState-a db.SaveChanges(); return(0); } catch (Exception) { return(-1); } } }